Struct stun_codec::AttributeType
source · pub struct AttributeType(/* private fields */);
Expand description
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.
Implementations§
source§impl AttributeType
impl AttributeType
sourcepub fn is_comprehension_required(self) -> bool
pub fn is_comprehension_required(self) -> bool
Returns true
if this is a comprehension-required type.
sourcepub fn is_comprehension_optional(self) -> bool
pub fn is_comprehension_optional(self) -> bool
Returns true
if this is a comprehension-optional type.
Trait Implementations§
source§impl Clone for AttributeType
impl Clone for AttributeType
source§fn clone(&self) -> AttributeType
fn clone(&self) -> AttributeType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AttributeType
impl Debug for AttributeType
source§impl From<u16> for AttributeType
impl From<u16> for AttributeType
source§impl Hash for AttributeType
impl Hash for AttributeType
source§impl Ord for AttributeType
impl Ord for AttributeType
source§fn cmp(&self, other: &AttributeType) -> Ordering
fn cmp(&self, other: &AttributeType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for AttributeType
impl PartialEq for AttributeType
source§fn eq(&self, other: &AttributeType) -> bool
fn eq(&self, other: &AttributeType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for AttributeType
impl PartialOrd for AttributeType
source§fn partial_cmp(&self, other: &AttributeType) -> Option<Ordering>
fn partial_cmp(&self, other: &AttributeType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for AttributeType
impl Eq for AttributeType
impl StructuralPartialEq for AttributeType
Auto Trait Implementations§
impl Freeze for AttributeType
impl RefUnwindSafe for AttributeType
impl Send for AttributeType
impl Sync for AttributeType
impl Unpin for AttributeType
impl UnwindSafe for AttributeType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more