Struct stun_codec::rfc5389::attributes::ErrorCode [−][src]
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.
fn get_type(&self) -> AttributeType
[src]
fn before_encode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
[src]
fn after_decode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
[src]
impl Clone for ErrorCode
[src]
impl Debug for ErrorCode
[src]
impl Eq for ErrorCode
[src]
impl From<AllocationMismatch> for ErrorCode
[src]
fn from(_: AllocationMismatch) -> Self
[src]
impl From<AllocationQuotaReached> for ErrorCode
[src]
fn from(_: AllocationQuotaReached) -> Self
[src]
impl From<BadRequest> for ErrorCode
[src]
fn from(_: BadRequest) -> Self
[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]
fn from(_: InsufficientCapacity) -> Self
[src]
impl From<RoleConflict> for ErrorCode
[src]
fn from(_: RoleConflict) -> Self
[src]
impl From<ServerError> for ErrorCode
[src]
fn from(_: ServerError) -> Self
[src]
impl From<StaleNonce> for ErrorCode
[src]
fn from(_: StaleNonce) -> Self
[src]
impl From<TryAlternate> for ErrorCode
[src]
fn from(_: TryAlternate) -> Self
[src]
impl From<Unauthorized> for ErrorCode
[src]
fn from(_: Unauthorized) -> Self
[src]
impl From<UnknownAttribute> for ErrorCode
[src]
fn from(_: UnknownAttribute) -> Self
[src]
impl From<UnsupportedTransportProtocol> for ErrorCode
[src]
fn from(_: UnsupportedTransportProtocol) -> Self
[src]
impl From<WrongCredentials> for ErrorCode
[src]
fn from(_: WrongCredentials) -> Self
[src]
impl Hash for ErrorCode
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ErrorCode> for ErrorCode
[src]
impl StructuralEq for ErrorCode
[src]
impl StructuralPartialEq for ErrorCode
[src]
impl TryAsRef<ErrorCode> for Attribute
[src]
fn try_as_ref(&self) -> Option<&ErrorCode>
[src]
Auto Trait Implementations
impl RefUnwindSafe for ErrorCode
[src]
impl Send for ErrorCode
[src]
impl Sync for ErrorCode
[src]
impl Unpin for ErrorCode
[src]
impl UnwindSafe for ErrorCode
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,