Struct stun_codec::rfc5766::attributes::Lifetime [−][src]
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.
fn get_type(&self) -> AttributeType
[src]
fn before_encode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
[src]
fn after_decode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
[src]
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Lifetime> for Lifetime
[src]
impl StructuralEq for Lifetime
[src]
impl StructuralPartialEq for Lifetime
[src]
impl TryAsRef<Lifetime> for Attribute
[src]
fn try_as_ref(&self) -> Option<&Lifetime>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Lifetime
[src]
impl Send for Lifetime
[src]
impl Sync for Lifetime
[src]
impl Unpin for Lifetime
[src]
impl UnwindSafe for Lifetime
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,