pub struct AddressErrorCode { /* private fields */ }
Expand description
This attribute is used by servers to signal the reason for not allocating the requested address family.
§Examples
let error = stun_rs::ErrorCode::new(508, "Insufficient Capacity")?;
let attr = AddressErrorCode::new(AddressFamily::IPv4, error);
assert_eq!(attr.error_code().class(), 5);
assert_eq!(attr.error_code().number(), 8);
assert_eq!(attr.error_code().reason(), "Insufficient Capacity");
assert_eq!(attr.family(), AddressFamily::IPv4);
Implementations§
source§impl AddressErrorCode
impl AddressErrorCode
sourcepub fn new(family: AddressFamily, error_code: ErrorCode) -> Self
pub fn new(family: AddressFamily, error_code: ErrorCode) -> Self
sourcepub fn family(&self) -> AddressFamily
pub fn family(&self) -> AddressFamily
Returns the error code value .
sourcepub fn error_code(&self) -> &ErrorCode
pub fn error_code(&self) -> &ErrorCode
Returns the error code value .
Trait Implementations§
source§impl Clone for AddressErrorCode
impl Clone for AddressErrorCode
source§fn clone(&self) -> AddressErrorCode
fn clone(&self) -> AddressErrorCode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AddressErrorCode
impl Debug for AddressErrorCode
source§impl From<AddressErrorCode> for StunAttribute
impl From<AddressErrorCode> for StunAttribute
source§fn from(value: AddressErrorCode) -> Self
fn from(value: AddressErrorCode) -> Self
Converts to this type from the input type.
source§impl PartialEq for AddressErrorCode
impl PartialEq for AddressErrorCode
source§impl StunAttributeType for AddressErrorCode
impl StunAttributeType for AddressErrorCode
source§fn get_type() -> AttributeTypewhere
Self: Sized,
fn get_type() -> AttributeTypewhere
Self: Sized,
Returns the STUN attribute type.
source§fn attribute_type(&self) -> AttributeType
fn attribute_type(&self) -> AttributeType
Returns the STUN attribute type of this instance.
impl Eq for AddressErrorCode
impl StructuralPartialEq for AddressErrorCode
Auto Trait Implementations§
impl Freeze for AddressErrorCode
impl RefUnwindSafe for AddressErrorCode
impl Send for AddressErrorCode
impl Sync for AddressErrorCode
impl Unpin for AddressErrorCode
impl UnwindSafe for AddressErrorCode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)