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
Object Safety§
This trait is not object safe.