Struct stun_codec::AttributeType [−][src]
pub struct AttributeType(_);
Attribute type.
Attributes are divided into two types: comprehension-required and comprehension-optional. STUN agents can safely ignore comprehension-optional attributes they don't understand, but cannot successfully process a message if it contains comprehension-required attributes that are not understood.
A STUN Attribute type is a hex number in the range 0x0000 - 0xFFFF. STUN attribute types in the range 0x0000 - 0x7FFF are considered comprehension-required; STUN attribute types in the range 0x8000 - 0xFFFF are considered comprehension-optional.
Methods
impl AttributeType
[src]
impl AttributeType
pub fn new(codepoint: u16) -> Self
[src]
pub fn new(codepoint: u16) -> Self
Makes a new Type
instance which corresponding to codepoint
.
pub fn as_u16(self) -> u16
[src]
pub fn as_u16(self) -> u16
Returns the attribute codepoint corresponding this instance.
pub fn is_comprehension_required(self) -> bool
[src]
pub fn is_comprehension_required(self) -> bool
Returns true
if this is a comprehension-required type.
pub fn is_comprehension_optional(self) -> bool
[src]
pub fn is_comprehension_optional(self) -> bool
Returns true
if this is a comprehension-optional type.
Trait Implementations
impl Debug for AttributeType
[src]
impl Debug for AttributeType
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 AttributeType
[src]
impl Clone for AttributeType
fn clone(&self) -> AttributeType
[src]
fn clone(&self) -> AttributeType
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 Copy for AttributeType
[src]
impl Copy for AttributeType
impl PartialOrd for AttributeType
[src]
impl PartialOrd for AttributeType
fn partial_cmp(&self, other: &AttributeType) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &AttributeType) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &AttributeType) -> bool
[src]
fn lt(&self, other: &AttributeType) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &AttributeType) -> bool
[src]
fn le(&self, other: &AttributeType) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &AttributeType) -> bool
[src]
fn gt(&self, other: &AttributeType) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &AttributeType) -> bool
[src]
fn ge(&self, other: &AttributeType) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for AttributeType
[src]
impl Ord for AttributeType
fn cmp(&self, other: &AttributeType) -> Ordering
[src]
fn cmp(&self, other: &AttributeType) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialEq for AttributeType
[src]
impl PartialEq for AttributeType
fn eq(&self, other: &AttributeType) -> bool
[src]
fn eq(&self, other: &AttributeType) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &AttributeType) -> bool
[src]
fn ne(&self, other: &AttributeType) -> bool
This method tests for !=
.
impl Eq for AttributeType
[src]
impl Eq for AttributeType
impl Hash for AttributeType
[src]
impl Hash for AttributeType
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 From<u16> for AttributeType
[src]
impl From<u16> for AttributeType
Auto Trait Implementations
impl Send for AttributeType
impl Send for AttributeType
impl Sync for AttributeType
impl Sync for AttributeType