pub struct ErrorCode(_);Expand description
The ERROR-CODE attribute is used in error response messages.
Examples
let error = stun_rs::ErrorCode::new(420, "Unknown Attribute")?;
let attr = ErrorCode::from(error);
assert_eq!(attr.error_code().class(), 4);
assert_eq!(attr.error_code().number(), 20);
assert_eq!(attr.error_code().reason(), "Unknown Attribute");Implementations
sourceimpl ErrorCode
impl ErrorCode
sourcepub fn new(error_code: ErrorCodeType) -> Self
pub fn new(error_code: ErrorCodeType) -> Self
sourcepub fn error_code(&self) -> &ErrorCodeType
pub fn error_code(&self) -> &ErrorCodeType
Returns the error code value .
Trait Implementations
sourceimpl From<ErrorCode> for ErrorCode
impl From<ErrorCode> for ErrorCode
sourcefn from(error: ErrorCodeType) -> Self
fn from(error: ErrorCodeType) -> Self
Converts to this type from the input type.
sourceimpl From<ErrorCode> for StunAttribute
impl From<ErrorCode> for StunAttribute
sourceimpl StunAttributeType for ErrorCode
impl StunAttributeType for ErrorCode
sourcefn get_type() -> AttributeTypewhere
Self: Sized,
fn get_type() -> AttributeTypewhere
Self: Sized,
Returns the STUN attribute type.
sourcefn attribute_type(&self) -> AttributeType
fn attribute_type(&self) -> AttributeType
Returns the STUN attribute type of this instance.
impl Eq for ErrorCode
impl StructuralEq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more