pub struct ArpPacketBuilder<'buffer, 'input> { /* private fields */ }Expand description
Builds one RFC 826 packet in a caller-provided buffer.
Implementations§
Source§impl<'buffer, 'input> ArpPacketBuilder<'buffer, 'input>
impl<'buffer, 'input> ArpPacketBuilder<'buffer, 'input>
Sourcepub fn new(buffer: &'buffer mut [u8]) -> Self
pub fn new(buffer: &'buffer mut [u8]) -> Self
Starts a builder whose result borrows only buffer.
Sourcepub fn hardware_type(self, value: ArpHardwareType) -> Self
pub fn hardware_type(self, value: ArpHardwareType) -> Self
Supplies the RFC 826 hardware type.
Sourcepub fn protocol_type(self, value: ArpProtocolType) -> Self
pub fn protocol_type(self, value: ArpProtocolType) -> Self
Supplies the RFC 826 protocol type.
Sourcepub fn operation(self, value: ArpOperation) -> Self
pub fn operation(self, value: ArpOperation) -> Self
Supplies the RFC 826 operation.
Sourcepub fn addresses(
self,
sender_hardware: &'input [u8],
sender_protocol: &'input [u8],
target_hardware: &'input [u8],
target_protocol: &'input [u8],
) -> Self
pub fn addresses( self, sender_hardware: &'input [u8], sender_protocol: &'input [u8], target_hardware: &'input [u8], target_protocol: &'input [u8], ) -> Self
Supplies sender-hardware, sender-protocol, target-hardware, and target-protocol addresses.
Sourcepub fn build(self) -> Result<ArpPacketMut<'buffer>, ArpPacketBuildError>
pub fn build(self) -> Result<ArpPacketMut<'buffer>, ArpPacketBuildError>
Validates every field and capacity before writing; trailing buffer bytes remain unchanged.
Auto Trait Implementations§
impl<'buffer, 'input> !UnwindSafe for ArpPacketBuilder<'buffer, 'input>
impl<'buffer, 'input> Freeze for ArpPacketBuilder<'buffer, 'input>
impl<'buffer, 'input> RefUnwindSafe for ArpPacketBuilder<'buffer, 'input>
impl<'buffer, 'input> Send for ArpPacketBuilder<'buffer, 'input>
impl<'buffer, 'input> Sync for ArpPacketBuilder<'buffer, 'input>
impl<'buffer, 'input> Unpin for ArpPacketBuilder<'buffer, 'input>
impl<'buffer, 'input> UnsafeUnpin for ArpPacketBuilder<'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