pub enum LinkLayer<'a> {
Ethernet(EtherHeaderVlan<'a>),
Sll(&'a SllHeader),
Sllv2(&'a Sllv2Header),
Null(&'a NullHeader),
}Variants§
Implementations§
Trait Implementations§
Source§impl SourceDestLayer<EthAddr> for LinkLayer<'_>
impl SourceDestLayer<EthAddr> for LinkLayer<'_>
Source§fn source(&self) -> Option<EthAddr>
fn source(&self) -> Option<EthAddr>
Extracts the source Ethernet MAC address from the link layer header.
Returns the source MAC address if this is an Ethernet header,
otherwise returns None for other link layer types (SLL, SLLv2, NULL).
§Returns
Some(EthAddr)- The source MAC address for Ethernet framesNone- No MAC address available for non-Ethernet link layers
Source§fn dest(&self) -> Option<EthAddr>
fn dest(&self) -> Option<EthAddr>
Extracts the destination Ethernet MAC address from the link layer header.
Returns the destination MAC address if this is an Ethernet header,
otherwise returns None for other link layer types (SLL, SLLv2, NULL).
§Returns
Some(EthAddr)- The destination MAC address for Ethernet framesNone- No MAC address available for non-Ethernet link layers
Auto Trait Implementations§
impl<'a> Freeze for LinkLayer<'a>
impl<'a> RefUnwindSafe for LinkLayer<'a>
impl<'a> Send for LinkLayer<'a>
impl<'a> Sync for LinkLayer<'a>
impl<'a> Unpin for LinkLayer<'a>
impl<'a> UnsafeUnpin for LinkLayer<'a>
impl<'a> UnwindSafe for LinkLayer<'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