pub unsafe trait FixedSizeValue: Copy {
// Required method
fn is_valid(data: &[u8]) -> bool;
}
Expand description
Marker trait for HCI values that have a known, fixed size
§Safety
- Must not contain any padding (uninitialized) bytes (recursively)
- structs must be
#[repr(C)]
or#[repr(transparent)]
- enums must be
#[repr(<int>)]
- Must not contain any references, pointers, atomics, or interior mutability
is_valid()
must return true only ifdata
is a valid bit representation ofSelf
Required Methods§
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.