pub struct EthernetFrame<B> { /* private fields */ }
Expand description
An Ethernet frame.
An EthernetFrame
shares its underlying memory with the byte slice it was
parsed from or serialized to, meaning that no copying or extra allocation is
necessary.
Implementations§
Source§impl<B: SplitByteSlice> EthernetFrame<B>
impl<B: SplitByteSlice> EthernetFrame<B>
Sourcepub fn ethertype(&self) -> Option<EtherType>
pub fn ethertype(&self) -> Option<EtherType>
The EtherType.
ethertype
returns the EtherType
from the Ethernet header. However,
some values of the EtherType header field are used to indicate the
length of the frame’s body. In this case, ethertype
returns None
.
Sourcepub fn builder(&self) -> EthernetFrameBuilder
pub fn builder(&self) -> EthernetFrameBuilder
Construct a builder with the same contents as this frame.
Trait Implementations§
Source§impl<B: SplitByteSlice> ParsablePacket<B, EthernetFrameLengthCheck> for EthernetFrame<B>
impl<B: SplitByteSlice> ParsablePacket<B, EthernetFrameLengthCheck> for EthernetFrame<B>
Source§fn parse_metadata(&self) -> ParseMetadata
fn parse_metadata(&self) -> ParseMetadata
Gets metadata about this packet required by [
GrowBuffer::undo_parse
]. Read moreSource§fn parse<BV: BufferView<B>>(
buffer: BV,
length_check: EthernetFrameLengthCheck,
) -> ParseResult<Self>
fn parse<BV: BufferView<B>>( buffer: BV, length_check: EthernetFrameLengthCheck, ) -> ParseResult<Self>
Parses a packet from a buffer. Read more
Auto Trait Implementations§
impl<B> Freeze for EthernetFrame<B>where
B: Freeze,
impl<B> RefUnwindSafe for EthernetFrame<B>where
B: RefUnwindSafe,
impl<B> Send for EthernetFrame<B>where
B: Send,
impl<B> Sync for EthernetFrame<B>where
B: Sync,
impl<B> Unpin for EthernetFrame<B>where
B: Unpin,
impl<B> UnwindSafe for EthernetFrame<B>where
B: UnwindSafe,
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