Struct stun_codec::rfc5389::attributes::ErrorCode
source · pub struct ErrorCode { /* private fields */ }
Expand description
ERROR-CODE
attribute.
See RFC 5389 – 15.6. ERROR-CODE about this attribute.
Implementations§
source§impl ErrorCode
impl ErrorCode
sourcepub fn new(code: u16, reason_phrase: String) -> Result<Self>
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.
sourcepub fn reason_phrase(&self) -> &str
pub fn reason_phrase(&self) -> &str
Returns the reason phrase of this error.
Trait Implementations§
source§impl Attribute for ErrorCode
impl Attribute for ErrorCode
§type Decoder = ErrorCodeDecoder
type Decoder = ErrorCodeDecoder
The decoder of the value part of the attribute.
§type Encoder = ErrorCodeEncoder
type Encoder = ErrorCodeEncoder
The encoder of the value part of the attribute.
source§fn get_type(&self) -> AttributeType
fn get_type(&self) -> AttributeType
Returns the type of the attribute.
source§impl From<AddressFamilyNotSupported> for ErrorCode
impl From<AddressFamilyNotSupported> for ErrorCode
source§fn from(_: AddressFamilyNotSupported) -> Self
fn from(_: AddressFamilyNotSupported) -> Self
Converts to this type from the input type.
source§impl From<AllocationMismatch> for ErrorCode
impl From<AllocationMismatch> for ErrorCode
source§fn from(_: AllocationMismatch) -> Self
fn from(_: AllocationMismatch) -> Self
Converts to this type from the input type.
source§impl From<AllocationQuotaReached> for ErrorCode
impl From<AllocationQuotaReached> for ErrorCode
source§fn from(_: AllocationQuotaReached) -> Self
fn from(_: AllocationQuotaReached) -> Self
Converts to this type from the input type.
source§impl From<BadRequest> for ErrorCode
impl From<BadRequest> for ErrorCode
source§fn from(_: BadRequest) -> Self
fn from(_: BadRequest) -> Self
Converts to this type from the input type.
source§impl From<InsufficientCapacity> for ErrorCode
impl From<InsufficientCapacity> for ErrorCode
source§fn from(_: InsufficientCapacity) -> Self
fn from(_: InsufficientCapacity) -> Self
Converts to this type from the input type.
source§impl From<MobilityForbidden> for ErrorCode
impl From<MobilityForbidden> for ErrorCode
source§fn from(_: MobilityForbidden) -> Self
fn from(_: MobilityForbidden) -> Self
Converts to this type from the input type.
source§impl From<PeerAddressFamilyMismatch> for ErrorCode
impl From<PeerAddressFamilyMismatch> for ErrorCode
source§fn from(_: PeerAddressFamilyMismatch) -> Self
fn from(_: PeerAddressFamilyMismatch) -> Self
Converts to this type from the input type.
source§impl From<RoleConflict> for ErrorCode
impl From<RoleConflict> for ErrorCode
source§fn from(_: RoleConflict) -> Self
fn from(_: RoleConflict) -> Self
Converts to this type from the input type.
source§impl From<ServerError> for ErrorCode
impl From<ServerError> for ErrorCode
source§fn from(_: ServerError) -> Self
fn from(_: ServerError) -> Self
Converts to this type from the input type.
source§impl From<StaleNonce> for ErrorCode
impl From<StaleNonce> for ErrorCode
source§fn from(_: StaleNonce) -> Self
fn from(_: StaleNonce) -> Self
Converts to this type from the input type.
source§impl From<TryAlternate> for ErrorCode
impl From<TryAlternate> for ErrorCode
source§fn from(_: TryAlternate) -> Self
fn from(_: TryAlternate) -> Self
Converts to this type from the input type.
source§fn from(_: Unauthorized) -> Self
fn from(_: Unauthorized) -> Self
Converts to this type from the input type.
source§impl From<UnknownAttribute> for ErrorCode
impl From<UnknownAttribute> for ErrorCode
source§fn from(_: UnknownAttribute) -> Self
fn from(_: UnknownAttribute) -> Self
Converts to this type from the input type.
source§impl From<UnsupportedTransportProtocol> for ErrorCode
impl From<UnsupportedTransportProtocol> for ErrorCode
source§fn from(_: UnsupportedTransportProtocol) -> Self
fn from(_: UnsupportedTransportProtocol) -> Self
Converts to this type from the input type.
source§impl From<WrongCredentials> for ErrorCode
impl From<WrongCredentials> for ErrorCode
source§fn from(_: WrongCredentials) -> Self
fn from(_: WrongCredentials) -> Self
Converts to this type from the input type.
source§impl PartialEq<ErrorCode> for ErrorCode
impl PartialEq<ErrorCode> for ErrorCode
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§
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