Struct etherparse::Ethernet2HeaderSlice
source · pub struct Ethernet2HeaderSlice<'a> { /* private fields */ }
Expand description
A slice containing an ethernet 2 header of a network package.
Implementations§
source§impl<'a> Ethernet2HeaderSlice<'a>
impl<'a> Ethernet2HeaderSlice<'a>
sourcepub fn from_slice(slice: &'a [u8]) -> Result<Ethernet2HeaderSlice<'a>, LenError>
pub fn from_slice(slice: &'a [u8]) -> Result<Ethernet2HeaderSlice<'a>, LenError>
Creates a ethernet slice from an other slice.
sourcepub fn destination(&self) -> [u8; 6]
pub fn destination(&self) -> [u8; 6]
Read the destination MAC address
sourcepub fn ether_type(&self) -> EtherType
pub fn ether_type(&self) -> EtherType
Read the ether_type field of the header indicating the protocol after the header.
sourcepub fn to_header(&self) -> Ethernet2Header
pub fn to_header(&self) -> Ethernet2Header
Decode all the fields and copy the results to a Ethernet2Header
struct
Trait Implementations§
source§impl<'a> Clone for Ethernet2HeaderSlice<'a>
impl<'a> Clone for Ethernet2HeaderSlice<'a>
source§fn clone(&self) -> Ethernet2HeaderSlice<'a>
fn clone(&self) -> Ethernet2HeaderSlice<'a>
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<'a> Debug for Ethernet2HeaderSlice<'a>
impl<'a> Debug for Ethernet2HeaderSlice<'a>
source§impl<'a> PartialEq for Ethernet2HeaderSlice<'a>
impl<'a> PartialEq for Ethernet2HeaderSlice<'a>
source§fn eq(&self, other: &Ethernet2HeaderSlice<'a>) -> bool
fn eq(&self, other: &Ethernet2HeaderSlice<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> Eq for Ethernet2HeaderSlice<'a>
impl<'a> StructuralPartialEq for Ethernet2HeaderSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for Ethernet2HeaderSlice<'a>
impl<'a> RefUnwindSafe for Ethernet2HeaderSlice<'a>
impl<'a> Send for Ethernet2HeaderSlice<'a>
impl<'a> Sync for Ethernet2HeaderSlice<'a>
impl<'a> Unpin for Ethernet2HeaderSlice<'a>
impl<'a> UnwindSafe for Ethernet2HeaderSlice<'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