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.

Implementations

impl ErrorCode[src]

pub const CODEPOINT: u16[src]

The codepoint of the type of the attribute.

pub fn new(code: u16, reason_phrase: String) -> Result<Self>[src]

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]

Returns the code of this error.

pub fn reason_phrase(&self) -> &str[src]

Returns the reason phrase of this error.

Trait Implementations

impl Attribute for ErrorCode[src]

type Decoder = ErrorCodeDecoder

The decoder of the value part of the attribute.

type Encoder = ErrorCodeEncoder

The encoder of the value part of the attribute.

impl Clone for ErrorCode[src]

impl Debug for ErrorCode[src]

impl Eq for ErrorCode[src]

impl From<AllocationMismatch> for ErrorCode[src]

impl From<AllocationQuotaReached> for ErrorCode[src]

impl From<BadRequest> for ErrorCode[src]

impl From<Error> for ErrorCode[src]

impl From<ErrorCode> for Attribute[src]

impl From<Forbidden> for ErrorCode[src]

impl From<InsufficientCapacity> for ErrorCode[src]

impl From<RoleConflict> for ErrorCode[src]

impl From<ServerError> for ErrorCode[src]

impl From<StaleNonce> for ErrorCode[src]

impl From<TryAlternate> for ErrorCode[src]

impl From<Unauthorized> for ErrorCode[src]

impl From<UnknownAttribute> for ErrorCode[src]

impl From<UnsupportedTransportProtocol> for ErrorCode[src]

impl From<WrongCredentials> for ErrorCode[src]

impl Hash for ErrorCode[src]

impl PartialEq<ErrorCode> for ErrorCode[src]

impl StructuralEq for ErrorCode[src]

impl StructuralPartialEq for ErrorCode[src]

impl TryAsRef<ErrorCode> for Attribute[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.