pub trait CRSerializeable {
const CRHEAD: u16 = 43_690u16;
const CRTAIL: u16 = 21_845u16;
const CRSIZE: usize = 0usize;
// Required methods
fn deserialize(
bytestream: &Vec<u8>,
pos: &mut usize,
) -> Result<Self, CRSerializationError>
where Self: Sized;
fn serialize(&self) -> Vec<u8> ⓘ;
// Provided method
fn verify_fixed(
stream: &Vec<u8>,
pos: &mut usize,
) -> Result<(), CRSerializationError> { ... }
}
Provided Associated Constants§
Required Methods§
Sourcefn deserialize(
bytestream: &Vec<u8>,
pos: &mut usize,
) -> Result<Self, CRSerializationError>where
Self: Sized,
fn deserialize(
bytestream: &Vec<u8>,
pos: &mut usize,
) -> Result<Self, CRSerializationError>where
Self: Sized,
Decode a serializable from a bytestream
Provided Methods§
Sourcefn verify_fixed(
stream: &Vec<u8>,
pos: &mut usize,
) -> Result<(), CRSerializationError>
fn verify_fixed( stream: &Vec<u8>, pos: &mut usize, ) -> Result<(), CRSerializationError>
Verify that the serialized representation of the struct has the correct size, including header + footer.
Will panic for variable sized structs.
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.