pub trait Value: Debug {
type SelfType<'a>: Debug + 'a
where Self: 'a;
type AsBytes<'a>: AsRef<[u8]> + 'a
where Self: 'a;
// Required methods
fn fixed_width() -> Option<usize>;
fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a;
fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'a + 'b;
fn type_name() -> TypeName;
}
Required Associated Types§
sourcetype SelfType<'a>: Debug + 'a
where
Self: 'a
type SelfType<'a>: Debug + 'a where Self: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a
type AsBytes<'a>: AsRef<[u8]> + 'a where Self: 'a
Required Methods§
sourcefn fixed_width() -> Option<usize>
fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width
sourcefn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>where
Self: 'a,
fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>where
Self: 'a,
Deserializes data Implementations may return a view over data, or an owned type
Object Safety§
This trait is not object safe.