pub trait SliceExt<'a>where
Self: Sized,{
// Required methods
fn from_bytes(data: &'a [u8]) -> Result<Self, ResourceStorageError>;
fn as_bytes(&self) -> &'a [u8] ⓘ;
}Expand description
Enhanced slices of flatdata Structs so that they can be created from bytes / converted to bytes Note: TryFrom/AsRef cannot be used, since slice is a foreign type
Required Methods§
Sourcefn from_bytes(data: &'a [u8]) -> Result<Self, ResourceStorageError>
fn from_bytes(data: &'a [u8]) -> Result<Self, ResourceStorageError>
Create a slice from an array of bytes
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.