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