Enum etherparse::LinkHeader
source · pub enum LinkHeader {
LinuxSll(LinuxSllHeader),
Ethernet2(Ethernet2Header),
}
Expand description
The possible headers on the link layer
Variants§
LinuxSll(LinuxSllHeader)
Ethernet2(Ethernet2Header)
Implementations§
source§impl LinkHeader
impl LinkHeader
sourcepub fn ethernet2(self) -> Option<Ethernet2Header>
pub fn ethernet2(self) -> Option<Ethernet2Header>
Returns Option::Some
containing the Ethernet2Header
if self has the
value Ethernet2. Otherwise Option::None
is returned.
sourcepub fn mut_ethernet2(&mut self) -> Option<&mut Ethernet2Header>
pub fn mut_ethernet2(&mut self) -> Option<&mut Ethernet2Header>
Returns Option::Some
containing the Ethernet2Header
if self has the
value Ethernet2. Otherwise Option::None
is returned.
sourcepub fn linux_sll(self) -> Option<LinuxSllHeader>
pub fn linux_sll(self) -> Option<LinuxSllHeader>
Returns Option::Some
containing the LinuxSllHeader
if self has the
value LinuxSll. Otherwise Option::None
is returned.
sourcepub fn mut_linux_sll(&mut self) -> Option<&mut LinuxSllHeader>
pub fn mut_linux_sll(&mut self) -> Option<&mut LinuxSllHeader>
Returns Option::Some
containing the LinuxSllHeader
if self has the
value LinuxSll. Otherwise Option::None
is returned.
sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the size of the link header
Trait Implementations§
source§impl Clone for LinkHeader
impl Clone for LinkHeader
source§fn clone(&self) -> LinkHeader
fn clone(&self) -> LinkHeader
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 Debug for LinkHeader
impl Debug for LinkHeader
source§impl PartialEq for LinkHeader
impl PartialEq for LinkHeader
source§fn eq(&self, other: &LinkHeader) -> bool
fn eq(&self, other: &LinkHeader) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for LinkHeader
impl StructuralPartialEq for LinkHeader
Auto Trait Implementations§
impl Freeze for LinkHeader
impl RefUnwindSafe for LinkHeader
impl Send for LinkHeader
impl Sync for LinkHeader
impl Unpin for LinkHeader
impl UnwindSafe for LinkHeader
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