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

Provided Associated Constants

Required Methods

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.

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

Implementations on Foreign Types

Implementors