Enum etherparse::ValueError[][src]

pub enum ValueError {
Show 16 variants Ipv4OptionsLengthBad(usize), Ipv4PayloadLengthTooLarge(usize), Ipv6PayloadLengthTooLarge(usize), Ipv6ExtensionPayloadTooSmall(usize), Ipv6ExtensionPayloadTooLarge(usize), Ipv6ExtensionPayloadLengthUnaligned(usize), IpAuthenticationHeaderBadIcvLength(usize), Ipv4ExtensionNotReferenced(IpNumber), Ipv6ExtensionHopByHopNotAtStart, Ipv6ExtensionNotReferenced(IpNumber), Ipv6ExtensionNotDefinedReference(IpNumber), UdpPayloadLengthTooLarge(usize), TcpLengthTooLarge(usize), U8TooLarge { value: u8, max: u8, field: ErrorField, }, U16TooLarge { value: u16, max: u16, field: ErrorField, }, U32TooLarge { value: u32, max: u32, field: ErrorField, },
}
Expand description

Errors in the given data

Variants

Ipv4OptionsLengthBad(usize)

Tuple Fields

0: usize

Error when the ipv4 options length is too big or not aligned (cannot be bigger then 40 bytes and must be a multiple of 4 bytes).

Ipv4PayloadLengthTooLarge(usize)

Tuple Fields

0: usize

Error when a given payload & ipv4 header is bigger then what fits inside an ipv4 total_length field.

Ipv6PayloadLengthTooLarge(usize)

Tuple Fields

0: usize

Error when a given payload & ipv6 header block is bigger then what fits inside an ipv6 payload_length field.

Ipv6ExtensionPayloadTooSmall(usize)

Tuple Fields

0: usize

Error when a given payload size is smaller then 6 octets which is the minimum ipv6 extended header size (Ipv6RawExtensionHeader::MAX_PAYLOAD_LEN).

Ipv6ExtensionPayloadTooLarge(usize)

Tuple Fields

0: usize

Error when a given payload size is bigger then what fits inside an ipv6 extended header size (Ipv6RawExtensionHeader::MAX_PAYLOAD_LEN).

Ipv6ExtensionPayloadLengthUnaligned(usize)

Tuple Fields

0: usize

Error when a given payload length is not aligned to be a multiple of 8 octets when 6 is substracted and can not be represented by the header length field.

IpAuthenticationHeaderBadIcvLength(usize)

Tuple Fields

0: usize

Error when a given authentication header icv size is not a multiple of 4 bytes or bigger then 1016 bytes and therefor can not be represented in the header length field.

Ipv4ExtensionNotReferenced(IpNumber)

Tuple Fields

Error when a header in Ipv4Extensions is never written as it is never referenced by any of the other next_header fields or the initial protocol.

Ipv6ExtensionHopByHopNotAtStart

Error when a hop-by-hop header is not referenced as the first header after the ipv6 header but as a later extension header.

Ipv6ExtensionNotReferenced(IpNumber)

Tuple Fields

Error when a header in Ipv6Extensions is never written as it is never referenced by any of the other next_header fields or the initial ip number.

Ipv6ExtensionNotDefinedReference(IpNumber)

Tuple Fields

Error when a header in Ipv6Extensions is referenced multiple times or is referenced and not defined.

UdpPayloadLengthTooLarge(usize)

Tuple Fields

0: usize

Error when a given payload is bigger then what fits inside an udp packet Note that a the maximum payload size, as far as udp is conceirned, is max_value(u16) - 8. The 8 is for the size of the udp header itself.

TcpLengthTooLarge(usize)

Tuple Fields

0: usize

Error when a given payload + tcp header options is bigger then what fits inside an tcp packet Note that a the maximum size, as far as tcp is conceirned, is max_value(u16) - tcp_header.data_offset()*4. The data_offset is for the size of the udp header itself.

U8TooLarge

Fields

value: u8
max: u8
field: ErrorField

Error when a u8 field in a header has a larger value then supported.

U16TooLarge

Fields

value: u16
max: u16
field: ErrorField

Error when a u16 field in a header has a larger value then supported.

U32TooLarge

Fields

value: u32
max: u32
field: ErrorField

Error when a u32 field in a header has a larger value then supported.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

Uses borrowed data to replace owned data, usually by cloning. Read more

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.