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§impl PartialOrd for NonZeroNdpLifetime
impl PartialOrd for NonZeroNdpLifetime
impl 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)