Struct stun_codec::rfc5766::attributes::Lifetime [−][src]
pub struct Lifetime(_);
LIFETIME
attribute.
See RFC 5766 -- 14.2. LIFETIME about this attribute.
Methods
impl Lifetime
[src]
impl Lifetime
pub const CODEPOINT: u16
CODEPOINT: u16 = 13
The codepoint of the type of the attribute.
pub fn new(lifetime: Duration) -> Result<Self>
[src]
pub fn new(lifetime: Duration) -> Result<Self>
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]
pub fn from_u32(lifetime_seconds: u32) -> Self
Makes a new Lifetime
instance from u32
value.
pub fn lifetime(&self) -> Duration
[src]
pub fn lifetime(&self) -> Duration
Returns the lifetime indicated by the attribute.
Trait Implementations
impl Debug for Lifetime
[src]
impl Debug for Lifetime
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Lifetime
[src]
impl Clone for Lifetime
fn clone(&self) -> Lifetime
[src]
fn clone(&self) -> Lifetime
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for Lifetime
[src]
impl PartialEq for Lifetime
fn eq(&self, other: &Lifetime) -> bool
[src]
fn eq(&self, other: &Lifetime) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Lifetime) -> bool
[src]
fn ne(&self, other: &Lifetime) -> bool
This method tests for !=
.
impl Eq for Lifetime
[src]
impl Eq for Lifetime
impl Hash for Lifetime
[src]
impl Hash for Lifetime
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Attribute for Lifetime
[src]
impl Attribute for Lifetime
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 get_type(&self) -> AttributeType
Returns the type of the attribute.
fn before_encode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
[src]
fn before_encode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
This method is called before encoding the attribute. Read more
fn after_decode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
[src]
fn after_decode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
This method is called after decoding the attribute and before being appended to the given message. Read more
impl From<Lifetime> for Attribute
[src]
impl From<Lifetime> for Attribute
impl TryAsRef<Lifetime> for Attribute
[src]
impl TryAsRef<Lifetime> for Attribute
fn try_as_ref(&self) -> Option<&Lifetime>
[src]
fn try_as_ref(&self) -> Option<&Lifetime>
Attempts to convert self
to a reference to T
. Read more