Struct stun_codec::rfc5766::attributes::ChannelNumber [−][src]
pub struct ChannelNumber(_);
CHANNEL-NUMBER
attribute.
See RFC 5766 -- 14.1. CHANNEL-NUMBER about this attribute.
Methods
impl ChannelNumber
[src]
impl ChannelNumber
pub const CODEPOINT: u16
CODEPOINT: u16 = 12
The codepoint of the type of the attribute.
pub const MIN: u16
MIN: u16 = 16384
Minimum channel number.
pub const MAX: u16
MAX: u16 = 32767
Maximum channel number.
pub fn new(n: u16) -> Result<Self>
[src]
pub fn new(n: u16) -> Result<Self>
Makes a new ChannelNumber
instance.
Errors
If n
is not a number between ChannelNumber::MIN
and ChannelNumber::MAX
,
this will return an ErrorKind::InvalidInput
error.
pub fn value(self) -> u16
[src]
pub fn value(self) -> u16
Returns the channel number indicated by the attribute.
Trait Implementations
impl Debug for ChannelNumber
[src]
impl Debug for ChannelNumber
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 ChannelNumber
[src]
impl Clone for ChannelNumber
fn clone(&self) -> ChannelNumber
[src]
fn clone(&self) -> ChannelNumber
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 ChannelNumber
[src]
impl Copy for ChannelNumber
impl PartialEq for ChannelNumber
[src]
impl PartialEq for ChannelNumber
fn eq(&self, other: &ChannelNumber) -> bool
[src]
fn eq(&self, other: &ChannelNumber) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ChannelNumber) -> bool
[src]
fn ne(&self, other: &ChannelNumber) -> bool
This method tests for !=
.
impl Eq for ChannelNumber
[src]
impl Eq for ChannelNumber
impl Hash for ChannelNumber
[src]
impl Hash for ChannelNumber
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 PartialOrd for ChannelNumber
[src]
impl PartialOrd for ChannelNumber
fn partial_cmp(&self, other: &ChannelNumber) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &ChannelNumber) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &ChannelNumber) -> bool
[src]
fn lt(&self, other: &ChannelNumber) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &ChannelNumber) -> bool
[src]
fn le(&self, other: &ChannelNumber) -> 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: &ChannelNumber) -> bool
[src]
fn gt(&self, other: &ChannelNumber) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &ChannelNumber) -> bool
[src]
fn ge(&self, other: &ChannelNumber) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for ChannelNumber
[src]
impl Ord for ChannelNumber
fn cmp(&self, other: &ChannelNumber) -> Ordering
[src]
fn cmp(&self, other: &ChannelNumber) -> 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 Attribute for ChannelNumber
[src]
impl Attribute for ChannelNumber
type Decoder = ChannelNumberDecoder
The decoder of the value part of the attribute.
type Encoder = ChannelNumberEncoder
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<ChannelNumber> for Attribute
[src]
impl From<ChannelNumber> for Attribute
fn from(f: ChannelNumber) -> Self
[src]
fn from(f: ChannelNumber) -> Self
Performs the conversion.
impl TryAsRef<ChannelNumber> for Attribute
[src]
impl TryAsRef<ChannelNumber> for Attribute
fn try_as_ref(&self) -> Option<&ChannelNumber>
[src]
fn try_as_ref(&self) -> Option<&ChannelNumber>
Attempts to convert self
to a reference to T
. Read more
Auto Trait Implementations
impl Send for ChannelNumber
impl Send for ChannelNumber
impl Sync for ChannelNumber
impl Sync for ChannelNumber