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 AttributeTypepub fn new(codepoint: u16) -> Self[src]
pub fn new(codepoint: u16) -> SelfMakes a new Type instance which corresponding to codepoint.
pub fn as_u16(self) -> u16[src]
pub fn as_u16(self) -> u16Returns the attribute codepoint corresponding this instance.
pub fn is_comprehension_required(self) -> bool[src]
pub fn is_comprehension_required(self) -> boolReturns true if this is a comprehension-required type.
pub fn is_comprehension_optional(self) -> bool[src]
pub fn is_comprehension_optional(self) -> boolReturns true if this is a comprehension-optional type.
Trait Implementations
impl Debug for AttributeType[src]
impl Debug for AttributeTypefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for AttributeType[src]
impl Clone for AttributeTypefn clone(&self) -> AttributeType[src]
fn clone(&self) -> AttributeTypeReturns 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 AttributeTypeimpl PartialOrd for AttributeType[src]
impl PartialOrd for AttributeTypefn 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) -> boolThis 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) -> boolThis 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) -> boolThis 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) -> boolThis 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 AttributeTypefn cmp(&self, other: &AttributeType) -> Ordering[src]
fn cmp(&self, other: &AttributeType) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl PartialEq for AttributeType[src]
impl PartialEq for AttributeTypefn eq(&self, other: &AttributeType) -> bool[src]
fn eq(&self, other: &AttributeType) -> boolThis 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) -> boolThis method tests for !=.
impl Eq for AttributeType[src]
impl Eq for AttributeTypeimpl Hash for AttributeType[src]
impl Hash for AttributeTypefn 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 AttributeTypeAuto Trait Implementations
impl Send for AttributeType
impl Send for AttributeTypeimpl Sync for AttributeType
impl Sync for AttributeType