Struct stun_codec::rfc5766::attributes::Lifetime[][src]

pub struct Lifetime(_);

LIFETIME attribute.

See RFC 5766 -- 14.2. LIFETIME about this attribute.

Implementations

impl Lifetime[src]

pub const CODEPOINT: u16[src]

The codepoint of the type of the attribute.

pub fn new(lifetime: Duration) -> Result<Self>[src]

Makes a new Lifetime instance.

Note that the nanoseconds part of lifetime is ignored and always set to 0.

Errors

If the seconds part of lifetime is greater than 0xFFFF_FFFF, this function will return an ErrorKind::InvalidInput error.

pub fn from_u32(lifetime_seconds: u32) -> Self[src]

Makes a new Lifetime instance from u32 value.

pub fn lifetime(&self) -> Duration[src]

Returns the lifetime indicated by the attribute.

Trait Implementations

impl Attribute for Lifetime[src]

type Decoder = LifetimeDecoder

The decoder of the value part of the attribute.

type Encoder = LifetimeEncoder

The encoder of the value part of the attribute.

impl Clone for Lifetime[src]

impl Debug for Lifetime[src]

impl Eq for Lifetime[src]

impl From<Lifetime> for Attribute[src]

impl Hash for Lifetime[src]

impl PartialEq<Lifetime> for Lifetime[src]

impl StructuralEq for Lifetime[src]

impl StructuralPartialEq for Lifetime[src]

impl TryAsRef<Lifetime> for Attribute[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.