pub trait FixedGattValue: FromGatt {
const SIZE: usize;
// Required methods
fn from_gatt(data: &[u8]) -> Result<Self, FromGattError>;
fn as_gatt(&self) -> &[u8];
}
Expand description
Trait to allow conversion of a fixed size type to and from a byte slice
Required Associated Constants§
Required Methods§
Sourcefn from_gatt(data: &[u8]) -> Result<Self, FromGattError>
fn from_gatt(data: &[u8]) -> Result<Self, FromGattError>
Converts from gatt bytes. Must return FromGattError::InvalidLength if data.len != Self::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.