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<ErrorCode, Error>
pub fn new(code: u16, reason_phrase: String) -> Result<ErrorCode, Error>
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
Source§type Decoder = ErrorCodeDecoder
type Decoder = ErrorCodeDecoder
The decoder of the value part of the attribute.
Source§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) -> ErrorCode
fn from(_: AddressFamilyNotSupported) -> ErrorCode
Converts to this type from the input type.
Source§impl From<AllocationMismatch> for ErrorCode
impl From<AllocationMismatch> for ErrorCode
Source§fn from(_: AllocationMismatch) -> ErrorCode
fn from(_: AllocationMismatch) -> ErrorCode
Converts to this type from the input type.
Source§impl From<AllocationQuotaReached> for ErrorCode
impl From<AllocationQuotaReached> for ErrorCode
Source§fn from(_: AllocationQuotaReached) -> ErrorCode
fn from(_: AllocationQuotaReached) -> ErrorCode
Converts to this type from the input type.
Source§impl From<BadRequest> for ErrorCode
impl From<BadRequest> for ErrorCode
Source§fn from(_: BadRequest) -> ErrorCode
fn from(_: BadRequest) -> ErrorCode
Converts to this type from the input type.
Source§impl From<InsufficientCapacity> for ErrorCode
impl From<InsufficientCapacity> for ErrorCode
Source§fn from(_: InsufficientCapacity) -> ErrorCode
fn from(_: InsufficientCapacity) -> ErrorCode
Converts to this type from the input type.
Source§impl From<MobilityForbidden> for ErrorCode
impl From<MobilityForbidden> for ErrorCode
Source§fn from(_: MobilityForbidden) -> ErrorCode
fn from(_: MobilityForbidden) -> ErrorCode
Converts to this type from the input type.
Source§impl From<PeerAddressFamilyMismatch> for ErrorCode
impl From<PeerAddressFamilyMismatch> for ErrorCode
Source§fn from(_: PeerAddressFamilyMismatch) -> ErrorCode
fn from(_: PeerAddressFamilyMismatch) -> ErrorCode
Converts to this type from the input type.
Source§impl From<RoleConflict> for ErrorCode
impl From<RoleConflict> for ErrorCode
Source§fn from(_: RoleConflict) -> ErrorCode
fn from(_: RoleConflict) -> ErrorCode
Converts to this type from the input type.
Source§impl From<ServerError> for ErrorCode
impl From<ServerError> for ErrorCode
Source§fn from(_: ServerError) -> ErrorCode
fn from(_: ServerError) -> ErrorCode
Converts to this type from the input type.
Source§impl From<StaleNonce> for ErrorCode
impl From<StaleNonce> for ErrorCode
Source§fn from(_: StaleNonce) -> ErrorCode
fn from(_: StaleNonce) -> ErrorCode
Converts to this type from the input type.
Source§impl From<TryAlternate> for ErrorCode
impl From<TryAlternate> for ErrorCode
Source§fn from(_: TryAlternate) -> ErrorCode
fn from(_: TryAlternate) -> ErrorCode
Converts to this type from the input type.
Source§fn from(_: Unauthorized) -> ErrorCode
fn from(_: Unauthorized) -> ErrorCode
Converts to this type from the input type.
Source§impl From<UnknownAttribute> for ErrorCode
impl From<UnknownAttribute> for ErrorCode
Source§fn from(_: UnknownAttribute) -> ErrorCode
fn from(_: UnknownAttribute) -> ErrorCode
Converts to this type from the input type.
Source§impl From<UnsupportedTransportProtocol> for ErrorCode
impl From<UnsupportedTransportProtocol> for ErrorCode
Source§fn from(_: UnsupportedTransportProtocol) -> ErrorCode
fn from(_: UnsupportedTransportProtocol) -> ErrorCode
Converts to this type from the input type.
Source§impl From<WrongCredentials> for ErrorCode
impl From<WrongCredentials> for ErrorCode
Source§fn from(_: WrongCredentials) -> ErrorCode
fn from(_: WrongCredentials) -> ErrorCode
Converts to this type from the input type.
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
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