pub struct Icmpv6Header {
    pub icmp_type: Icmpv6Type,
    pub checksum: u16,
}
Expand description

The statically sized data at the start of an ICMPv6 packet (at least the first 8 bytes of an ICMPv6 packet).

Fields§

§icmp_type: Icmpv6Type

Type & type specific values & code.

§checksum: u16

Checksum in the ICMPv6 header.

Implementations§

Minimum number of bytes an ICMP header needs to have.

Note that minimum size can be larger depending on the type and code.

Maximum number of bytes/octets an Icmpv6Header takes up in serialized form.

Currently this number is determined by the biggest planned ICMPv6 header type, which is currently the “Neighbor Discovery Protocol” “Redirect” message.

Setups a new header with the checksum beeing set to 0.

Creates a Icmpv6Header with a checksum calculated based on the given payload & ip addresses from the IPv6 header.

Reads an icmp6 header from a slice directly and returns a tuple containing the resulting header & unused part of the slice.

Read a ICMPv6 header from the given reader

Write the ICMPv6 header to the given writer.

Serialized length of the header in bytes/octets.

Note that this size is not the size of the entire ICMPv6 packet but only the header.

If the ICMP type has a fixed size returns the number of bytes that should be present after the header of this type.

Updates the checksum of the header.

Returns the header on the wire bytes.

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.