Struct etherparse::Ethernet2HeaderSlice [−][src]
pub struct Ethernet2HeaderSlice<'a> { /* fields omitted */ }
A slice containing an ethernet 2 header of a network package.
Methods
impl<'a> Ethernet2HeaderSlice<'a>
[src]
impl<'a> Ethernet2HeaderSlice<'a>
pub fn from_slice(
slice: &'a [u8]
) -> Result<Ethernet2HeaderSlice<'a>, ReadError>
[src]
pub fn from_slice(
slice: &'a [u8]
) -> Result<Ethernet2HeaderSlice<'a>, ReadError>
Creates a ethernet slice from an other slice.
pub fn slice(&self) -> &'a [u8]
[src]
pub fn slice(&self) -> &'a [u8]
Returns the slice containing the ethernet 2 header
pub fn destination(&self) -> &'a [u8]
[src]
pub fn destination(&self) -> &'a [u8]
Read the destination mac address
pub fn source(&self) -> &'a [u8]
[src]
pub fn source(&self) -> &'a [u8]
Read the source mac address
pub fn ether_type(&self) -> u16
[src]
pub fn ether_type(&self) -> u16
Read the ether_type field of the header (in system native byte order).
pub fn to_header(&self) -> Ethernet2Header
[src]
pub fn to_header(&self) -> Ethernet2Header
Decode all the fields and copy the results to a Ipv4Header struct
Trait Implementations
impl<'a> Clone for Ethernet2HeaderSlice<'a>
[src]
impl<'a> Clone for Ethernet2HeaderSlice<'a>
fn clone(&self) -> Ethernet2HeaderSlice<'a>
[src]
fn clone(&self) -> Ethernet2HeaderSlice<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<'a> Debug for Ethernet2HeaderSlice<'a>
[src]
impl<'a> Debug for Ethernet2HeaderSlice<'a>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> Eq for Ethernet2HeaderSlice<'a>
[src]
impl<'a> Eq for Ethernet2HeaderSlice<'a>
impl<'a> PartialEq for Ethernet2HeaderSlice<'a>
[src]
impl<'a> PartialEq for Ethernet2HeaderSlice<'a>
fn eq(&self, other: &Ethernet2HeaderSlice<'a>) -> bool
[src]
fn eq(&self, other: &Ethernet2HeaderSlice<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Ethernet2HeaderSlice<'a>) -> bool
[src]
fn ne(&self, other: &Ethernet2HeaderSlice<'a>) -> bool
This method tests for !=
.
Auto Trait Implementations
impl<'a> Send for Ethernet2HeaderSlice<'a>
impl<'a> Send for Ethernet2HeaderSlice<'a>
impl<'a> Sync for Ethernet2HeaderSlice<'a>
impl<'a> Sync for Ethernet2HeaderSlice<'a>