Struct etherparse::Icmpv6Slice

source ·
pub struct Icmpv6Slice<'a> { /* private fields */ }
Expand description

A slice containing an ICMPv6 network package.

Struct allows the selective read of fields in the ICMPv6 packet.

Implementations§

Creates a slice containing an ICMPv6 packet.

Errors

The function will return an Err ReadError::UnexpectedEndOfSlice if the given slice is too small (smaller then Icmpv6Header::MIN_SERIALIZED_SIZE) or too large (bigger then icmpv6::MAX_ICMPV6_BYTE_LEN).

Decode the header fields and copy the results to a Icmpv6Header struct.

Number of bytes/octets that will be converted into a Icmpv6Header when Icmpv6Slice::header gets called.

Decode the header values (excluding the checksum) into an Icmpv6Type enum.

Returns “type” value in the ICMPv6 header.

Returns “code” value in the ICMPv6 header.

Returns “checksum” value in the ICMPv6 header.

Returns if the checksum in the slice is correct.

Returns the bytes from position 4 till and including the 8th position in the ICMPv6 header.

These bytes located at th 5th, 6th, 7th and 8th position of the ICMP packet can depending on the ICMPv6 type and code contain additional data.

Returns the slice containing the ICMPv6 packet.

Returns a slice to the bytes not covered by .header().

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.