Struct someip_parse::err::LenError
source · pub struct LenError {
pub required_len: usize,
pub len: usize,
pub len_source: LenSource,
pub layer: Layer,
}
Expand description
Error when different lengths are conflicting with each other (e.g. not enough data in a slice to decode a header).
This error is triggered whenever there is not enough data to decode an element (e.g. if a slice is too small to decode an header) or if a length that is inhered from an upper layer is too small for the lower layer (e.g. length inherited from an SOMEIP header is too small to to decode the SOMEIP TP header).
When the error is caused by not enough data beeing available
required_len > len
must be true.
Fields§
§required_len: usize
Expected minimum or maximum length conflicting with the
len
value.
len: usize
Length limiting or exceeding the required length.
len_source: LenSource
Source of the outer length (e.g. Slice or a length specified by an upper level protocol).
layer: Layer
Layer in which the length error was encountered.
Trait Implementations§
source§impl Error for LenError
impl Error for LenError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl Ord for LenError
impl Ord for LenError
source§impl PartialEq for LenError
impl PartialEq for LenError
source§impl PartialOrd for LenError
impl PartialOrd for LenError
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more