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
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.