Trait reanim_decode::stream::PlainData
source · pub trait PlainData: Sized {
const SIZE_IN_BYTES: usize;
const TYPE_NAME: &'static str;
// Required method
fn from_bytes(data: &[u8]) -> Option<Self>;
}
Expand description
Plain old data, with a constant size known in advance.
Required Associated Constants§
sourceconst SIZE_IN_BYTES: usize
const SIZE_IN_BYTES: usize
Size of this data in bytes.
Required Methods§
sourcefn from_bytes(data: &[u8]) -> Option<Self>
fn from_bytes(data: &[u8]) -> Option<Self>
Decode from a byte sequence.
§Note
Length of the input slice is guaranteed to be Self::SIZE_IN_BYTES
, but this information
cannot be encoded in the type system (yet), due to limitations of min_const_generics
.
Object Safety§
This trait is not object safe.