Struct zero_packet::datalink::ethernet::EthernetParser
source · pub struct EthernetParser<'a> { /* private fields */ }
Expand description
Represents an Ethernet frame parser.
Implementations§
source§impl<'a> EthernetParser<'a>
impl<'a> EthernetParser<'a>
sourcepub fn new(data: &'a [u8]) -> Result<Self, &'static str>
pub fn new(data: &'a [u8]) -> Result<Self, &'static str>
Creates a new EthernetParser
from the given slice.
sourcepub fn ethertype(&self) -> u16
pub fn ethertype(&self) -> u16
Returns a reference to the EtherType field.
EtherType indicates which protcol is encapsulated in the payload.
sourcepub const fn header_len(&self) -> usize
pub const fn header_len(&self) -> usize
Returns the header length in bytes.
Trait Implementations§
source§impl<'a> Debug for EthernetParser<'a>
impl<'a> Debug for EthernetParser<'a>
source§impl<'a> PartialEq for EthernetParser<'a>
impl<'a> PartialEq for EthernetParser<'a>
source§fn eq(&self, other: &EthernetParser<'a>) -> bool
fn eq(&self, other: &EthernetParser<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> StructuralPartialEq for EthernetParser<'a>
Auto Trait Implementations§
impl<'a> Freeze for EthernetParser<'a>
impl<'a> RefUnwindSafe for EthernetParser<'a>
impl<'a> Send for EthernetParser<'a>
impl<'a> Sync for EthernetParser<'a>
impl<'a> Unpin for EthernetParser<'a>
impl<'a> UnwindSafe for EthernetParser<'a>
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