pub enum Lifetime {
Forever,
Seconds(u32),
}Expand description
valid_lft / preferred_lft as reported by the kernel. forever is
u32::MAX (4294967295) in ip -j; backends lift that to Lifetime::Forever.
Variants§
Implementations§
Source§impl Lifetime
impl Lifetime
Sourcepub fn is_expired(self) -> bool
pub fn is_expired(self) -> bool
Return true when the lifetime has reached zero (address expired).
Sourcepub fn as_duration(self) -> Option<Duration>
pub fn as_duration(self) -> Option<Duration>
Convert to a Duration, returning None for Lifetime::Forever.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lifetime
impl<'de> Deserialize<'de> for Lifetime
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Lifetime
impl Eq for Lifetime
impl StructuralPartialEq for Lifetime
Auto Trait Implementations§
impl Freeze for Lifetime
impl RefUnwindSafe for Lifetime
impl Send for Lifetime
impl Sync for Lifetime
impl Unpin for Lifetime
impl UnsafeUnpin for Lifetime
impl UnwindSafe for Lifetime
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