Skip to main content

Ipv6PacketBuilder

Struct Ipv6PacketBuilder 

Source
pub struct Ipv6PacketBuilder<'buffer> { /* private fields */ }
Expand description

Builds an RFC 8200 base header in a caller-provided packet buffer.

The builder validates every field and capacity before writing. It writes only the 40-octet base header; declared payload bytes and trailing capacity remain unchanged.

Implementations§

Source§

impl<'buffer> Ipv6PacketBuilder<'buffer>

Source

pub fn new(buffer: &'buffer mut [u8], payload_length: usize) -> Self

Starts a builder for an ordinary payload of payload_length octets.

A zero length produces an ordinary zero Payload Length field and no Jumbo Payload option.

Source

pub fn next_header(self, value: Ipv6NextHeader) -> Self

Supplies the Next Header field.

Source

pub fn hop_limit(self, value: u8) -> Self

Supplies the hop limit.

Source

pub fn source(self, value: Ipv6Address) -> Self

Supplies the source address.

Source

pub fn destination(self, value: Ipv6Address) -> Self

Supplies the destination address.

Source

pub fn traffic_class(self, value: u8) -> Self

Supplies the traffic class.

Source

pub fn flow_label(self, value: u32) -> Self

Supplies the 20-bit flow label.

Source

pub fn build(self) -> Result<Ipv6PacketMut<'buffer>, Ipv6PacketBuildError>

Validates the request and writes the RFC 8200 base header.

Auto Trait Implementations§

§

impl<'buffer> !UnwindSafe for Ipv6PacketBuilder<'buffer>

§

impl<'buffer> Freeze for Ipv6PacketBuilder<'buffer>

§

impl<'buffer> RefUnwindSafe for Ipv6PacketBuilder<'buffer>

§

impl<'buffer> Send for Ipv6PacketBuilder<'buffer>

§

impl<'buffer> Sync for Ipv6PacketBuilder<'buffer>

§

impl<'buffer> Unpin for Ipv6PacketBuilder<'buffer>

§

impl<'buffer> UnsafeUnpin for Ipv6PacketBuilder<'buffer>

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.