Enum packet_formats::icmp::ndp::NonZeroNdpLifetime
source · pub enum NonZeroNdpLifetime {
Finite(NonZeroDuration),
Infinite,
}
Expand description
A non-zero lifetime conveyed through NDP.
Variants§
Finite(NonZeroDuration)
A finite lifetime greater than zero.
Note that the finite lifetime is not statically guaranteed to be less than the infinite value representation of a field. E.g. for Prefix Information option lifetime 32-bit fields, infinity is represented as all 1s but it is possible for this variant to hold a value representing X seconds where X is >= 2^32.
Infinite
An infinite lifetime.
Implementations§
source§impl NonZeroNdpLifetime
impl NonZeroNdpLifetime
sourcepub fn from_u32_with_infinite(lifetime: u32) -> Option<NonZeroNdpLifetime>
pub fn from_u32_with_infinite(lifetime: u32) -> Option<NonZeroNdpLifetime>
Returns a Some(NonZeroNdpLifetime)
if the passed lifetime is non-zero;
otherwise None
.
sourcepub fn min_finite_duration(self, other: NonZeroDuration) -> NonZeroDuration
pub fn min_finite_duration(self, other: NonZeroDuration) -> NonZeroDuration
Returns the minimum finite duration.
Trait Implementations§
source§impl Clone for NonZeroNdpLifetime
impl Clone for NonZeroNdpLifetime
source§fn clone(&self) -> NonZeroNdpLifetime
fn clone(&self) -> NonZeroNdpLifetime
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 NonZeroNdpLifetime
impl Debug for NonZeroNdpLifetime
source§impl Ord for NonZeroNdpLifetime
impl Ord for NonZeroNdpLifetime
source§fn cmp(&self, other: &NonZeroNdpLifetime) -> Ordering
fn cmp(&self, other: &NonZeroNdpLifetime) -> 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 NonZeroNdpLifetime
impl PartialEq for NonZeroNdpLifetime
source§fn eq(&self, other: &NonZeroNdpLifetime) -> bool
fn eq(&self, other: &NonZeroNdpLifetime) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for NonZeroNdpLifetime
impl PartialOrd for NonZeroNdpLifetime
source§fn partial_cmp(&self, other: &NonZeroNdpLifetime) -> Option<Ordering>
fn partial_cmp(&self, other: &NonZeroNdpLifetime) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for NonZeroNdpLifetime
impl Eq for NonZeroNdpLifetime
impl StructuralPartialEq for NonZeroNdpLifetime
Auto Trait Implementations§
impl Freeze for NonZeroNdpLifetime
impl RefUnwindSafe for NonZeroNdpLifetime
impl Send for NonZeroNdpLifetime
impl Sync for NonZeroNdpLifetime
impl Unpin for NonZeroNdpLifetime
impl UnwindSafe for NonZeroNdpLifetime
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