#[non_exhaustive]pub enum StatusClass {
Success,
ClientError,
ServerError,
HubError,
Unknown,
}Available on crate feature
transport only.Expand description
The four status code ranges the specification defines.
Spec: 2.3.0 §status_codes_status_codes
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Success
1xxx — the request was handled as documented.
ClientError
2xxx — the data sent by the client cannot be processed by the server.
ServerError
3xxx — the server encountered an internal error.
HubError
4xxx — a hub failed to route the message.
Unknown
A code outside 1000–4999, which the specification does not define.
Implementations§
Source§impl StatusClass
impl StatusClass
Sourcepub const fn is_success(self) -> bool
pub const fn is_success(self) -> bool
Whether this class means the request succeeded.
Sourcepub const fn is_client_fault(self) -> bool
pub const fn is_client_fault(self) -> bool
Whether the fault lies with the party that sent the request.
Trait Implementations§
Source§impl Clone for StatusClass
impl Clone for StatusClass
Source§fn clone(&self) -> StatusClass
fn clone(&self) -> StatusClass
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StatusClass
Source§impl Debug for StatusClass
impl Debug for StatusClass
Source§impl Display for StatusClass
impl Display for StatusClass
impl Eq for StatusClass
Source§impl Hash for StatusClass
impl Hash for StatusClass
Source§impl PartialEq for StatusClass
impl PartialEq for StatusClass
impl StructuralPartialEq for StatusClass
Auto Trait Implementations§
impl Freeze for StatusClass
impl RefUnwindSafe for StatusClass
impl Send for StatusClass
impl Sync for StatusClass
impl Unpin for StatusClass
impl UnsafeUnpin for StatusClass
impl UnwindSafe for StatusClass
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.