pub struct EthernetFrameBuilder { /* private fields */ }
Expand description
A builder for Ethernet frames.
A [PacketBuilder
] that serializes into an Ethernet frame. The padding
parameter P
can be used to choose how the body of the frame is padded.
Implementations§
Source§impl EthernetFrameBuilder
impl EthernetFrameBuilder
Sourcepub fn new(
src_mac: Mac,
dst_mac: Mac,
ethertype: EtherType,
min_body_len: usize,
) -> EthernetFrameBuilder
pub fn new( src_mac: Mac, dst_mac: Mac, ethertype: EtherType, min_body_len: usize, ) -> EthernetFrameBuilder
Construct a new EthernetFrameBuilder
.
The provided source and destination Mac
addresses and EtherType
will be placed in the Ethernet frame header. The min_body_len
parameter sets the minimum length of the frame’s body in bytes. If,
during serialization, the inner packet builder produces a smaller body
than min_body_len
, it will be padded with trailing zero bytes up to
min_body_len
.
Trait Implementations§
Source§impl Clone for EthernetFrameBuilder
impl Clone for EthernetFrameBuilder
Source§fn clone(&self) -> EthernetFrameBuilder
fn clone(&self) -> EthernetFrameBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EthernetFrameBuilder
impl Debug for EthernetFrameBuilder
Source§impl PacketBuilder for EthernetFrameBuilder
impl PacketBuilder for EthernetFrameBuilder
Auto Trait Implementations§
impl Freeze for EthernetFrameBuilder
impl RefUnwindSafe for EthernetFrameBuilder
impl Send for EthernetFrameBuilder
impl Sync for EthernetFrameBuilder
impl Unpin for EthernetFrameBuilder
impl UnwindSafe for EthernetFrameBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more