pub struct Ipv4PacketBuilder<'buffer, 'input> { /* private fields */ }Expand description
Caller-buffer IPv4 builder.
Implementations§
Source§impl<'buffer, 'input> Ipv4PacketBuilder<'buffer, 'input>
impl<'buffer, 'input> Ipv4PacketBuilder<'buffer, 'input>
Sourcepub fn new(buffer: &'buffer mut [u8], payload: usize) -> Self
pub fn new(buffer: &'buffer mut [u8], payload: usize) -> Self
Starts a builder with untouched payload bytes.
Sourcepub fn source(self, v: Ipv4Address) -> Self
pub fn source(self, v: Ipv4Address) -> Self
Supplies source.
Sourcepub fn destination(self, v: Ipv4Address) -> Self
pub fn destination(self, v: Ipv4Address) -> Self
Supplies destination.
Sourcepub fn protocol(self, v: Ipv4Protocol) -> Self
pub fn protocol(self, v: Ipv4Protocol) -> Self
Supplies protocol.
Sourcepub fn identification(self, v: u16) -> Self
pub fn identification(self, v: u16) -> Self
Supplies identification.
Sourcepub fn flags_fragment_offset(self, v: u16) -> Self
pub fn flags_fragment_offset(self, v: u16) -> Self
Supplies flags and offset.
Sourcepub fn build(self) -> Result<Ipv4PacketMut<'buffer>, Ipv4PacketBuildError>
pub fn build(self) -> Result<Ipv4PacketMut<'buffer>, Ipv4PacketBuildError>
Validates before all writes, writes/header-checksums only the header, and preserves payload and trailing capacity.
Auto Trait Implementations§
impl<'buffer, 'input> !UnwindSafe for Ipv4PacketBuilder<'buffer, 'input>
impl<'buffer, 'input> Freeze for Ipv4PacketBuilder<'buffer, 'input>
impl<'buffer, 'input> RefUnwindSafe for Ipv4PacketBuilder<'buffer, 'input>
impl<'buffer, 'input> Send for Ipv4PacketBuilder<'buffer, 'input>
impl<'buffer, 'input> Sync for Ipv4PacketBuilder<'buffer, 'input>
impl<'buffer, 'input> Unpin for Ipv4PacketBuilder<'buffer, 'input>
impl<'buffer, 'input> UnsafeUnpin for Ipv4PacketBuilder<'buffer, 'input>
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