Enum etherparse::ReadError[][src]

pub enum ReadError {
    IoError(Error),
    UnexpectedEndOfSlice(usize),
    DoubleVlanOuterNonVlanEtherType(u16),
    IpUnsupportedVersion(u8),
    Ipv4UnexpectedVersion(u8),
    Ipv4HeaderLengthBad(u8),
    Ipv4TotalLengthTooSmall(u16),
    Ipv6UnexpectedVersion(u8),
    Ipv6TooManyHeaderExtensions,
    Ipv6HopByHopHeaderNotAtStart,
    IpAuthenticationHeaderTooSmallPayloadLength(u8),
    TcpDataOffsetTooSmall(u8),
}
Expand description

Errors that can occur when reading.

Variants

IoError(Error)

Tuple Fields

0: Error

Whenever an std::io::Error gets triggerd during a write it gets forwarded via this enum value.

UnexpectedEndOfSlice(usize)

Tuple Fields

0: usize

Error when an unexpected end of a slice was reached even though more data was expected to be present (expected minimum size as argument).

DoubleVlanOuterNonVlanEtherType(u16)

Tuple Fields

0: u16

Error when a double vlan tag was expected but the ether type of the the first vlan header does not an vlan header ether type. The value is the unexpected ether type value in the outer vlan header.

IpUnsupportedVersion(u8)

Tuple Fields

0: u8

Error when the ip header version is not supported (only 4 & 6 are supported). The value is the version that was received.

Ipv4UnexpectedVersion(u8)

Tuple Fields

0: u8

Error when the ip header version field is not equal 4. The value is the version that was received.

Ipv4HeaderLengthBad(u8)

Tuple Fields

0: u8

Error when the ipv4 header length is smaller then the header itself (5).

Ipv4TotalLengthTooSmall(u16)

Tuple Fields

0: u16

Error when the total length field is too small to contain the header itself.

Ipv6UnexpectedVersion(u8)

Tuple Fields

0: u8

Error when then ip header version field is not equal 6. The value is the version that was received.

Ipv6TooManyHeaderExtensions

Error when more then 7 header extensions are present (according to RFC82000 this should never happen).

Ipv6HopByHopHeaderNotAtStart

Error if the ipv6 hop by hop header does not occur directly after the ipv6 header (see rfc8200 chapter 4.1.)

IpAuthenticationHeaderTooSmallPayloadLength(u8)

Tuple Fields

0: u8

Error if the header length in the ip authentication header is smaller then the minimum size of 1.

TcpDataOffsetTooSmall(u8)

Tuple Fields

0: u8

Error given if the data_offset field in a TCP header is smaller then the minimum size of the tcp header itself.

Implementations

Adds an offset value to the UnexpectedEndOfSlice error.

Returns the std::io::Error value if the ReadError is an IoError. Otherwise `None is returned.

Returns the expected minimum size if the error is an UnexpectedEndOfSlice.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.