Enum etherparse::IpHeader

source ·
pub enum IpHeader {
    Version4(Ipv4HeaderIpv4Extensions),
    Version6(Ipv6HeaderIpv6Extensions),
}
Expand description

Internet protocol headers version 4 & 6

Variants§

Implementations§

👎Deprecated since 0.10.1: Renamed to IpHeader::from_slice

Renamed to IpHeader::from_slice

Read an IpvHeader from a slice and return the header & unused parts of the slice.

Reads an IP (v4 or v6) header from the current position.

Writes an IP (v4 or v6) header to the current position

Returns the size when the ip header & extensions are serialized

Returns the last next header number following the ip header and header extensions.

Sets all the next_header fields in the ipv4 & ipv6 header as well as in all extension headers and returns the ether type number.

The given number will be set as the last “next_header” or protocol number.

Tries to set the length field in the ip header given the length of data after the ip header and extension header(s).

If the payload length is too large to be stored in the length fields of the ip header an error is returned.

Note that this function will automatically add the length of the extension headers is they are present.

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
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.