pub trait SubRecord<'raw>: Sized {
const MIN_SERIALIZED_SIZE: usize;
const EXACT_SERIALIZED_SIZE: Option<usize> = None;
fn serialized_size(&self) -> usize;
fn _serialize_chained<W: Write>(&self, dest: &mut W) -> SeResult<usize>;
fn _deserialize_chained(raw: &'raw [u8]) -> DeResult<(usize, Self)>;
}Expand description
Internal trait used to reduce the amount of code that needs to be generated.
Required Associated Constants
const MIN_SERIALIZED_SIZE: usize
Provided Associated Constants
const EXACT_SERIALIZED_SIZE: Option<usize> = None
Required Methods
fn serialized_size(&self) -> usize
fn serialized_size(&self) -> usize
Exact size this will be once serialized in bytes.
Warning: call is recursive and costly to make if not needed.
Should only be called from generated code! Serialize this record. It is highly recommend to use a buffered writer.
fn _deserialize_chained(raw: &'raw [u8]) -> DeResult<(usize, Self)>
fn _deserialize_chained(raw: &'raw [u8]) -> DeResult<(usize, Self)>
Should only be called from generated code! Deserialize this object as a sub component of a larger message. Returns a tuple of (bytes_read, deserialized_value).