#[non_exhaustive]pub enum Bvll6Error {
TooShort {
length: usize,
},
NotBip6 {
bvlc_type: u8,
},
LengthMismatch {
declared: usize,
received: usize,
},
UnknownFunction {
function: u8,
},
PayloadLength {
function: Bvlc6Function,
length: usize,
},
AddressLength {
length: usize,
},
TooLong {
length: usize,
},
UndefinedResultCode {
code: u16,
},
BufferExhausted {
needed: usize,
available: usize,
},
}Expand description
A B/IPv6 BVLL message could not be decoded or encoded.
The variants mirror BvllError’s, for Annex U’s
type octet, address length and functions; B/IPv6 messages carry no
tables. Each one 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.
NotBip6
Decode: the BVLC Type octet is not 0x82, so the datagram is not a B/IPv6 BVLL message (Annex U.2).
LengthMismatch
Decode: the Length field disagrees with the datagram. It counts the whole message, header included (Annex U.2), so a datagram cut short and one with octets after the message both fail here.
UnknownFunction
Decode: a function code Annex U.2 doesn’t define, so its payload has no known layout.
PayloadLength
Decode: the payload doesn’t fit its function’s layout (see
Bvlc6Function::payload_shape).
AddressLength
A B/IPv6 address that is not 18 octets long (Annex U.1.1.2).
TooLong
Encode: the message is longer than its 16-bit Length field can state.
UndefinedResultCode
Encode: a BVLC-Result whose code Annex U.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§
Source§impl Clone for Bvll6Error
impl Clone for Bvll6Error
impl Copy for Bvll6Error
Source§impl Debug for Bvll6Error
impl Debug for Bvll6Error
Source§impl Display for Bvll6Error
impl Display for Bvll6Error
impl Eq for Bvll6Error
Source§impl Error for Bvll6Error
impl Error for Bvll6Error
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()