Enum etherparse::LinkSlice
source · pub enum LinkSlice<'a> {
Ethernet2(Ethernet2Slice<'a>),
EtherPayload(EtherPayloadSlice<'a>),
}
Expand description
A slice containing the link layer header (currently only Ethernet II is supported).
Variants§
Ethernet2(Ethernet2Slice<'a>)
A slice containing an Ethernet II header.
EtherPayload(EtherPayloadSlice<'a>)
Ether payload without header.
Implementations§
source§impl<'a> LinkSlice<'a>
impl<'a> LinkSlice<'a>
sourcepub fn to_header(&self) -> Option<Ethernet2Header>
pub fn to_header(&self) -> Option<Ethernet2Header>
Convert the link slice to a header (currently just the ethernet2 header as this is the only value it can take).
sourcepub fn payload(&self) -> EtherPayloadSlice<'a>
pub fn payload(&self) -> EtherPayloadSlice<'a>
Returns the link layer payload (slice + ether type number).
Trait Implementations§
source§impl<'a> PartialEq for LinkSlice<'a>
impl<'a> PartialEq for LinkSlice<'a>
impl<'a> Eq for LinkSlice<'a>
impl<'a> StructuralPartialEq for LinkSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for LinkSlice<'a>
impl<'a> RefUnwindSafe for LinkSlice<'a>
impl<'a> Send for LinkSlice<'a>
impl<'a> Sync for LinkSlice<'a>
impl<'a> Unpin for LinkSlice<'a>
impl<'a> UnwindSafe for LinkSlice<'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