Struct rustun::rfc5389::attributes::ErrorCode
[−]
[src]
pub struct ErrorCode { /* fields omitted */ }
ERROR-CODE
attribute.
See RFC 5389 -- 15.6. ERROR-CODE about this attribute.
Methods
impl ErrorCode
[src]
fn new(code: u16, reason_phrase: String) -> Option<Self>
Makes a new ErrorCode
instance.
Note that the value of code
must be in range of 300..600
.
If the value is out-of-range this will return None
.
fn code(&self) -> u16
Returns the code of this error.
fn reason_phrase(&self) -> &str
Returns the reason phrase of this error.
Trait Implementations
impl Debug for ErrorCode
[src]
impl Clone for ErrorCode
[src]
fn clone(&self) -> ErrorCode
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for ErrorCode
[src]
fn eq(&self, __arg_0: &ErrorCode) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ErrorCode) -> bool
This method tests for !=
.
impl Eq for ErrorCode
[src]
impl Hash for ErrorCode
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Attribute for ErrorCode
[src]
fn get_type(&self) -> Type
Returns the attribute type of this instance.
fn try_from_raw(attr: &RawAttribute, _message: &RawMessage) -> Result<Self>
Tries to convert from RawAttribute
. Read more
fn encode_value(&self, _message: &RawMessage) -> Result<Vec<u8>>
Tries to encode the value of this attribute to bytes.
fn try_to_raw(&self, message: &RawMessage) -> Result<RawAttribute>
Tries to convert to RawAttribute
. Read more
impl From<TryAlternate> for ErrorCode
[src]
fn from(_: TryAlternate) -> Self
Performs the conversion.
impl From<BadRequest> for ErrorCode
[src]
fn from(_: BadRequest) -> Self
Performs the conversion.
impl From<Unauthorized> for ErrorCode
[src]
fn from(_: Unauthorized) -> Self
Performs the conversion.
impl From<UnknownAttribute> for ErrorCode
[src]
fn from(_: UnknownAttribute) -> Self
Performs the conversion.
impl From<StaleNonce> for ErrorCode
[src]
fn from(_: StaleNonce) -> Self
Performs the conversion.
impl From<ServerError> for ErrorCode
[src]
fn from(_: ServerError) -> Self
Performs the conversion.