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
Source§fn parse_mut<BV>(buffer: BV, args: ParseArgs) -> Result<Self, Self::Error>where
BV: BufferViewMut<B>,
B: SplitByteSliceMut,
fn parse_mut<BV>(buffer: BV, args: ParseArgs) -> Result<Self, Self::Error>where
BV: BufferViewMut<B>,
B: SplitByteSliceMut,
Parses a packet from a mutable 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
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