Trait LengthField

Source
pub trait LengthField: Sized + Sealed {
    // Required methods
    fn get_length(reader: &mut ByteReader<'_>) -> Result<usize, ParseError>;
    fn from_length(length: usize) -> Result<Self, SerializeError>;
}
Expand description

A SOME/IP length field. Can be either u8, u16, or u32.

Required Methods§

Source

fn get_length(reader: &mut ByteReader<'_>) -> Result<usize, ParseError>

Parses the length field and returns the length as a usize.

Source

fn from_length(length: usize) -> Result<Self, SerializeError>

Creates a length field from the length as usize.

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.

Implementations on Foreign Types§

Source§

impl LengthField for u8

Source§

impl LengthField for u16

Source§

impl LengthField for u32

Implementors§