trouble-host

Crates

git

Versions

default

Flavors

Trait FromGatt

Source
pub trait FromGatt: AsGatt {
    // Required method
    fn from_gatt(data: &[u8]) -> Result<Self, FromGattError>;
}
Expand description

Trait to allow conversion of gatt bytes into a type

Requires that the type implements AsGatt

Required Methods§

Source

fn from_gatt(data: &[u8]) -> Result<Self, FromGattError>

Converts from gatt bytes. Must return FromGattError::InvalidLength if data.len not in MIN_SIZE..=MAX_SIZE

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<const N: usize> FromGatt for Vec<u8, N>

Source§

fn from_gatt(data: &[u8]) -> Result<Self, FromGattError>

Source§

impl<const N: usize> FromGatt for [u8; N]

Source§

fn from_gatt(data: &[u8]) -> Result<Self, FromGattError>

Implementors§