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>
impl<'buffer> Ipv6PacketBuilder<'buffer>
Sourcepub fn new(buffer: &'buffer mut [u8], payload_length: usize) -> Self
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.
Sourcepub fn next_header(self, value: Ipv6NextHeader) -> Self
pub fn next_header(self, value: Ipv6NextHeader) -> Self
Supplies the Next Header field.
Sourcepub fn source(self, value: Ipv6Address) -> Self
pub fn source(self, value: Ipv6Address) -> Self
Supplies the source address.
Sourcepub fn destination(self, value: Ipv6Address) -> Self
pub fn destination(self, value: Ipv6Address) -> Self
Supplies the destination address.
Sourcepub fn traffic_class(self, value: u8) -> Self
pub fn traffic_class(self, value: u8) -> Self
Supplies the traffic class.
Sourcepub fn flow_label(self, value: u32) -> Self
pub fn flow_label(self, value: u32) -> Self
Supplies the 20-bit flow label.
Sourcepub fn build(self) -> Result<Ipv6PacketMut<'buffer>, Ipv6PacketBuildError>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more