pub trait Packable:
PartialEq
+ Debug
+ ToOwned<Owned: Debug + Clone + PartialEq>
+ PartialOrd {
// Required methods
fn width(item: &Self) -> usize;
fn pack(item: &Self, out: &mut Vec<u8>);
fn unpack(buff: &[u8]) -> Result<(usize, Cow<'_, Self>), PackError>;
// Provided methods
fn abs(_item: &Self) -> i64 { ... }
fn agg(_item: &Self) -> Agg { ... }
fn maybe_agg(_item: &Option<Cow<'_, Self>>) -> Agg { ... }
fn validate(_val: Option<&Self>, _m: &ScanMeta) -> Result<(), PackError> { ... }
}Required Methods§
fn width(item: &Self) -> usize
fn pack(item: &Self, out: &mut Vec<u8>)
fn unpack(buff: &[u8]) -> Result<(usize, Cow<'_, Self>), PackError>
Provided Methods§
fn abs(_item: &Self) -> i64
fn agg(_item: &Self) -> Agg
fn maybe_agg(_item: &Option<Cow<'_, Self>>) -> Agg
fn validate(_val: Option<&Self>, _m: &ScanMeta) -> Result<(), PackError>
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.