pub struct LinuxSllPacketType(/* private fields */);Expand description
Represents an “Packet type”, indicating the direction where it was sent, used inside a SLL header
You can convert u16 in the valid range to an LinuxSllType and the
other way around
use etherparse::LinuxSllPacketType;
// Convert to LinuxSllPacketType using the try_from & try_into trait
let link_type: LinuxSllPacketType = 1_u16.try_into().unwrap();
assert_eq!(LinuxSllPacketType::BROADCAST, link_type);
// convert to u16 using the from & into trait
let num: u16 = LinuxSllPacketType::BROADCAST.into();
assert_eq!(1, num);Implementations§
Source§impl LinuxSllPacketType
impl LinuxSllPacketType
pub const HOST: LinuxSllPacketType
pub const BROADCAST: LinuxSllPacketType
pub const MULTICAST: LinuxSllPacketType
pub const OTHERHOST: LinuxSllPacketType
pub const OUTGOING: LinuxSllPacketType
pub const LOOPBACK: LinuxSllPacketType
pub const USER: LinuxSllPacketType
pub const KERNEL: LinuxSllPacketType
pub const MAX_VAL: u16 = 7u16
Trait Implementations§
Source§impl Clone for LinuxSllPacketType
impl Clone for LinuxSllPacketType
Source§fn clone(&self) -> LinuxSllPacketType
fn clone(&self) -> LinuxSllPacketType
Returns a duplicate 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 LinuxSllPacketType
impl Debug for LinuxSllPacketType
Source§impl Default for LinuxSllPacketType
impl Default for LinuxSllPacketType
Source§fn default() -> LinuxSllPacketType
fn default() -> LinuxSllPacketType
Returns the “default value” for a type. Read more
Source§impl From<LinuxSllPacketType> for u16
impl From<LinuxSllPacketType> for u16
Source§fn from(val: LinuxSllPacketType) -> Self
fn from(val: LinuxSllPacketType) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LinuxSllPacketType
impl PartialEq for LinuxSllPacketType
Source§impl TryFrom<u16> for LinuxSllPacketType
impl TryFrom<u16> for LinuxSllPacketType
impl Copy for LinuxSllPacketType
impl Eq for LinuxSllPacketType
impl StructuralPartialEq for LinuxSllPacketType
Auto Trait Implementations§
impl Freeze for LinuxSllPacketType
impl RefUnwindSafe for LinuxSllPacketType
impl Send for LinuxSllPacketType
impl Sync for LinuxSllPacketType
impl Unpin for LinuxSllPacketType
impl UnwindSafe for LinuxSllPacketType
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