Skip to main content

ArpPacketBuilder

Struct ArpPacketBuilder 

Source
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>

Source

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

Starts a builder whose result borrows only buffer.

Source

pub fn hardware_type(self, value: ArpHardwareType) -> Self

Supplies the RFC 826 hardware type.

Source

pub fn protocol_type(self, value: ArpProtocolType) -> Self

Supplies the RFC 826 protocol type.

Source

pub fn operation(self, value: ArpOperation) -> Self

Supplies the RFC 826 operation.

Source

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.

Source

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> 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.