#[non_exhaustive]pub enum BvllError {
TooShort {
length: usize,
},
NotBip {
bvlc_type: u8,
},
LengthMismatch {
declared: usize,
received: usize,
},
UnknownFunction {
function: u8,
},
PayloadLength {
function: BvlcFunction,
length: usize,
},
TableLength {
length: usize,
entry_length: usize,
},
AddressLength {
length: usize,
},
TooLong {
length: usize,
},
UndefinedResultCode {
code: u16,
},
BufferExhausted {
needed: usize,
available: usize,
},
}Expand description
A BVLL message could not be decoded or encoded.
Each variant names the direction it comes from. None of them allocates,
so the type is Copy. Later releases may add variants, so a match
outside this crate needs a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TooShort
Decode: the datagram is shorter than the 4-octet BVLL header.
NotBip
Decode: the BVLC Type octet is not 0x81, so the datagram is not a B/IP BVLL message (Annex J.2).
LengthMismatch
Decode: the Length field disagrees with the datagram. It counts the whole message, header included (Annex J.2), so a datagram cut short and one with octets after the message both fail here.
UnknownFunction
Decode: a function code Annex J.2 doesn’t define, so its payload has no known layout.
PayloadLength
Decode: the payload doesn’t fit its function’s layout (see
BvlcFunction::payload_shape).
TableLength
A table’s octets are not a whole number of entries.
AddressLength
A B/IP address that is not 6 octets long (Annex J.1.2).
TooLong
Encode: the message is longer than its 16-bit Length field can state.
UndefinedResultCode
Encode: a BVLC-Result whose code Annex J.2.1.1 doesn’t define.
BufferExhausted
Encode: the sink has no room for the message. Nothing was written to a sink with a fixed capacity.
Trait Implementations§
impl Copy for BvllError
impl Eq for BvllError
Source§impl Error for BvllError
impl Error for BvllError
1.30.0 · 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
use the Display impl or to_string()