Struct stun_codec::rfc5389::attributes::ErrorCode [−][src]
pub struct ErrorCode { /* fields omitted */ }
ERROR-CODE
attribute.
See RFC 5389 -- 15.6. ERROR-CODE about this attribute.
Methods
impl ErrorCode
[src]
impl ErrorCode
pub const CODEPOINT: u16
CODEPOINT: u16 = 9
The codepoint of the type of the attribute.
pub fn new(code: u16, reason_phrase: String) -> Result<Self>
[src]
pub fn new(code: u16, reason_phrase: String) -> Result<Self>
Makes a new ErrorCode
instance.
Errors
Note that the value of code
must be in range of 300..600
.
If the value is out-of-range this will return an ErrorKind::InvalidInput
error.
pub fn code(&self) -> u16
[src]
pub fn code(&self) -> u16
Returns the code of this error.
pub fn reason_phrase(&self) -> &str
[src]
pub fn reason_phrase(&self) -> &str
Returns the reason phrase of this error.
Trait Implementations
impl Debug for ErrorCode
[src]
impl Debug for ErrorCode
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 ErrorCode
[src]
impl Clone for ErrorCode
fn clone(&self) -> ErrorCode
[src]
fn clone(&self) -> ErrorCode
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 ErrorCode
[src]
impl PartialEq for ErrorCode
fn eq(&self, other: &ErrorCode) -> bool
[src]
fn eq(&self, other: &ErrorCode) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ErrorCode) -> bool
[src]
fn ne(&self, other: &ErrorCode) -> bool
This method tests for !=
.
impl Eq for ErrorCode
[src]
impl Eq for ErrorCode
impl Hash for ErrorCode
[src]
impl Hash for ErrorCode
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 ErrorCode
[src]
impl Attribute for ErrorCode
type Decoder = ErrorCodeDecoder
The decoder of the value part of the attribute.
type Encoder = ErrorCodeEncoder
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<Error> for ErrorCode
[src]
impl From<Error> for ErrorCode
impl From<TryAlternate> for ErrorCode
[src]
impl From<TryAlternate> for ErrorCode
fn from(_: TryAlternate) -> Self
[src]
fn from(_: TryAlternate) -> Self
Performs the conversion.
impl From<BadRequest> for ErrorCode
[src]
impl From<BadRequest> for ErrorCode
fn from(_: BadRequest) -> Self
[src]
fn from(_: BadRequest) -> Self
Performs the conversion.
impl From<Unauthorized> for ErrorCode
[src]
impl From<Unauthorized> for ErrorCode
fn from(_: Unauthorized) -> Self
[src]
fn from(_: Unauthorized) -> Self
Performs the conversion.
impl From<UnknownAttribute> for ErrorCode
[src]
impl From<UnknownAttribute> for ErrorCode
fn from(_: UnknownAttribute) -> Self
[src]
fn from(_: UnknownAttribute) -> Self
Performs the conversion.
impl From<StaleNonce> for ErrorCode
[src]
impl From<StaleNonce> for ErrorCode
fn from(_: StaleNonce) -> Self
[src]
fn from(_: StaleNonce) -> Self
Performs the conversion.
impl From<ServerError> for ErrorCode
[src]
impl From<ServerError> for ErrorCode
fn from(_: ServerError) -> Self
[src]
fn from(_: ServerError) -> Self
Performs the conversion.
impl From<ErrorCode> for Attribute
[src]
impl From<ErrorCode> for Attribute