pub struct NdpOptionType(pub u8);Expand description
Identifiers for Neighbor Discovery option Type values.
You can access the underlying u8 value via .0, and any u8 can
be converted into an NdpOptionType:
use etherparse::icmpv6::NdpOptionType;
assert_eq!(NdpOptionType::SOURCE_LINK_LAYER_ADDRESS.0, 1);
assert_eq!(NdpOptionType::SOURCE_LINK_LAYER_ADDRESS, NdpOptionType(1));
let option_type: NdpOptionType = 3u8.into();
assert_eq!(NdpOptionType::PREFIX_INFORMATION, option_type);
let raw: u8 = NdpOptionType::MTU.into();
assert_eq!(5, raw);Tuple Fields§
§0: u8Implementations§
Source§impl NdpOptionType
impl NdpOptionType
Sourcepub const SOURCE_LINK_LAYER_ADDRESS: Self
pub const SOURCE_LINK_LAYER_ADDRESS: Self
Source Link-Layer Address option [RFC4861].
Sourcepub const TARGET_LINK_LAYER_ADDRESS: Self
pub const TARGET_LINK_LAYER_ADDRESS: Self
Target Link-Layer Address option [RFC4861].
Sourcepub const PREFIX_INFORMATION: Self
pub const PREFIX_INFORMATION: Self
Prefix Information option [RFC4861].
Sourcepub const REDIRECTED_HEADER: Self
pub const REDIRECTED_HEADER: Self
Redirected Header option [RFC4861].
Sourcepub const fn keyword_str(self) -> Option<&'static str>
pub const fn keyword_str(self) -> Option<&'static str>
Human-readable name for known option types.
Trait Implementations§
Source§impl Clone for NdpOptionType
impl Clone for NdpOptionType
Source§fn clone(&self) -> NdpOptionType
fn clone(&self) -> NdpOptionType
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 NdpOptionType
impl Debug for NdpOptionType
Source§impl From<NdpOptionType> for u8
impl From<NdpOptionType> for u8
Source§fn from(val: NdpOptionType) -> Self
fn from(val: NdpOptionType) -> Self
Converts to this type from the input type.
Source§impl From<u8> for NdpOptionType
impl From<u8> for NdpOptionType
Source§impl Hash for NdpOptionType
impl Hash for NdpOptionType
Source§impl Ord for NdpOptionType
impl Ord for NdpOptionType
Source§fn cmp(&self, other: &NdpOptionType) -> Ordering
fn cmp(&self, other: &NdpOptionType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NdpOptionType
impl PartialEq for NdpOptionType
Source§impl PartialOrd for NdpOptionType
impl PartialOrd for NdpOptionType
impl Copy for NdpOptionType
impl Eq for NdpOptionType
impl StructuralPartialEq for NdpOptionType
Auto Trait Implementations§
impl Freeze for NdpOptionType
impl RefUnwindSafe for NdpOptionType
impl Send for NdpOptionType
impl Sync for NdpOptionType
impl Unpin for NdpOptionType
impl UnsafeUnpin for NdpOptionType
impl UnwindSafe for NdpOptionType
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