Skip to main content

Ipv6PacketMut

Struct Ipv6PacketMut 

Source
pub struct Ipv6PacketMut<'a> { /* private fields */ }
Expand description

A structurally validated mutable IPv6 base-header view.

Implementations§

Source§

impl<'a> Ipv6PacketMut<'a>

Source

pub fn icmpv6_mut( &mut self, ) -> Result<Option<Icmpv6MessageMut<'_>>, Ipv6DispatchError>

Parses mutable ICMPv6 after traversing supported IPv6 extension headers.

Source

pub fn udp_mut( &mut self, ) -> Result<Option<UdpDatagramMut<'_>>, Ipv6DispatchError>

Parses mutable UDP after traversing supported IPv6 extension headers.

Source

pub fn tcp_mut( &mut self, ) -> Result<Option<TcpSegmentMut<'_>>, Ipv6DispatchError>

Parses mutable TCP after traversing supported IPv6 extension headers.

Source§

impl<'a> Ipv6PacketMut<'a>

Source

pub fn parse(bytes: &'a mut [u8]) -> Result<Self, ParseError>

Validates the fixed header, version, and any nonzero declared payload extent.

Source

pub fn traffic_class(&self) -> u8

Returns the eight-bit traffic class.

Source

pub fn flow_label(&self) -> u32

Returns the 20-bit flow label.

Source

pub fn payload_length(&self) -> Ipv6PayloadLength

Interprets the Payload Length field without resolving Jumbo Payload options.

Source

pub fn raw_payload_length(&self) -> u16

Returns the raw 16-bit Payload Length field.

Source

pub fn next_header(&self) -> Ipv6NextHeader

Returns the Next Header value, preserving unknown values.

Source

pub fn hop_limit(&self) -> u8

Returns the hop limit.

Source

pub fn source(&self) -> Ipv6Address

Returns the source address.

Source

pub fn destination(&self) -> Ipv6Address

Returns the destination address.

Source

pub fn payload(&self) -> &[u8]

Returns bytes after the fixed header, with zero-field ambiguity as documented on Ipv6Packet.

Source

pub fn payload_mut(&mut self) -> &mut [u8] ⓘ

Returns bytes after the fixed header mutably.

Source

pub fn as_bytes(&self) -> &[u8]

Returns all represented bytes.

Source

pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ

Returns all represented bytes mutably.

Source

pub fn set_traffic_class(&mut self, value: u8)

Replaces the traffic class while preserving version and flow-label bits.

Source

pub fn set_flow_label(&mut self, value: u32) -> Result<(), Ipv6PacketBuildError>

Replaces the flow label, or leaves the packet unchanged when it exceeds 20 bits.

Source

pub fn set_next_header(&mut self, value: Ipv6NextHeader)

Replaces the Next Header value.

Source

pub fn set_hop_limit(&mut self, value: u8)

Replaces the hop limit.

Source

pub fn set_source(&mut self, value: Ipv6Address)

Replaces the source address.

Source

pub fn set_destination(&mut self, value: Ipv6Address)

Replaces the destination address.

Trait Implementations§

Source§

impl<'a> Debug for Ipv6PacketMut<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for Ipv6PacketMut<'a>

Source§

impl<'a> PartialEq for Ipv6PacketMut<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for Ipv6PacketMut<'a>

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for Ipv6PacketMut<'a>

§

impl<'a> Freeze for Ipv6PacketMut<'a>

§

impl<'a> RefUnwindSafe for Ipv6PacketMut<'a>

§

impl<'a> Send for Ipv6PacketMut<'a>

§

impl<'a> Sync for Ipv6PacketMut<'a>

§

impl<'a> Unpin for Ipv6PacketMut<'a>

§

impl<'a> UnsafeUnpin for Ipv6PacketMut<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.