Skip to main content

NpduDecodeError

Enum NpduDecodeError 

Source
pub enum NpduDecodeError {
    AddressTooLong {
        field: NpduAddressField,
        length: u8,
        dnet: Option<u16>,
        source: Option<NpduAddress>,
    },
    Malformed(Error),
}
Expand description

Why decode_npdu refused an NPDU.

Variants§

§

AddressTooLong

The DLEN or SLEN octet is larger than NpduAddress::MAX_MAC_LEN (#1141), so the address names no node on a standard data link or on one this stack serves.

Clause 6.4.4 gives routers Reject-Message-To-Network reason 6 (ADDRESSING_ERROR) for an NPDU whose DADR or SADR length is invalid. dnet is the network the reject names, and source is where it goes when a router relayed the refused NPDU (#1158).

Fields

§field: NpduAddressField

Which address the length octet introduces.

§length: u8

The DLEN or SLEN octet as received.

§dnet: Option<u16>

The NPDU’s DNET, when its control octet announces one. It precedes both length octets on the wire, so it is always known here.

§source: Option<NpduAddress>

The NPDU’s SNET/SADR, when the over-long field is the DADR and a complete, valid source follows the DLEN octets the frame announces. It is None when the SADR itself is the over-long field, since that source names no node.

§

Malformed(Error)

Any other malformation: a short buffer, an unknown protocol version, a reserved network number, SLEN 0, or a truncated address or field.

Trait Implementations§

Source§

impl Debug for NpduDecodeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for NpduDecodeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for NpduDecodeError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for NpduDecodeError

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<NpduDecodeError> for Error

Source§

fn from(error: NpduDecodeError) -> Self

An over-long address becomes Error::OutOfRange: the length octet is well formed, but its value is past the limit.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more