pub trait Size: Sized {
const SIZE: usize;
}Expand description
A trait for values with a known encoded size at compile time.
For all types implementin this trait, the following invariant must always be true:
let mut writer = Writer::new();
writer.write(Self);
assert_eq!(writer.data().len(), Self::SIZE);Required Associated Constants§
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.