Struct etherparse::Ethernet2HeaderSlice [−][src]
A slice containing an ethernet 2 header of a network package.
Implementations
impl<'a> Ethernet2HeaderSlice<'a>
[src]
pub fn from_slice(
slice: &'a [u8]
) -> Result<Ethernet2HeaderSlice<'a>, ReadError>
[src]
slice: &'a [u8]
) -> Result<Ethernet2HeaderSlice<'a>, ReadError>
Creates a ethernet slice from an other slice.
pub fn slice(&self) -> &'a [u8]
[src]
Returns the slice containing the ethernet 2 header
pub fn destination(&self) -> &'a [u8]
[src]
Read the destination mac address
pub fn source(&self) -> &'a [u8]
[src]
Read the source mac address
pub fn ether_type(&self) -> u16
[src]
Read the ether_type field of the header (in system native byte order).
pub fn to_header(&self) -> Ethernet2Header
[src]
Decode all the fields and copy the results to a Ipv4Header struct
Trait Implementations
impl<'a> Clone for Ethernet2HeaderSlice<'a>
[src]
fn clone(&self) -> Ethernet2HeaderSlice<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for Ethernet2HeaderSlice<'a>
[src]
impl<'a> Eq for Ethernet2HeaderSlice<'a>
[src]
impl<'a> PartialEq<Ethernet2HeaderSlice<'a>> for Ethernet2HeaderSlice<'a>
[src]
fn eq(&self, other: &Ethernet2HeaderSlice<'a>) -> bool
[src]
fn ne(&self, other: &Ethernet2HeaderSlice<'a>) -> bool
[src]
impl<'a> StructuralEq for Ethernet2HeaderSlice<'a>
[src]
impl<'a> StructuralPartialEq for Ethernet2HeaderSlice<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Ethernet2HeaderSlice<'a>
[src]
impl<'a> Send for Ethernet2HeaderSlice<'a>
[src]
impl<'a> Sync for Ethernet2HeaderSlice<'a>
[src]
impl<'a> Unpin for Ethernet2HeaderSlice<'a>
[src]
impl<'a> UnwindSafe for Ethernet2HeaderSlice<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,