pub unsafe trait ByteAlignedValue: FixedSizeValue {
// Provided method
fn ref_from_hci_bytes(
data: &[u8],
) -> Result<(&Self, &[u8]), FromHciBytesError> { ... }
}
Expand description
Marker trait for FixedSizeValue
s that have byte alignment.
§Safety
- Must have
core::mem::align_of::<T>() == 1
Provided Methods§
Sourcefn ref_from_hci_bytes(data: &[u8]) -> Result<(&Self, &[u8]), FromHciBytesError>
fn ref_from_hci_bytes(data: &[u8]) -> Result<(&Self, &[u8]), FromHciBytesError>
Obtain a reference to this type from a byte slice.
§Safety
- Must have
core::mem::align_of::<T>() == 1
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.