pub struct StatusCode(/* private fields */);
Expand description
Status code of a response.
§Comparing the status code
Status codes can easily be compared with status code integers due to
implementing PartialEq<u16>
. This is equivalent to checking against the
value returned by StatusCode::get
.
Implementations§
source§impl StatusCode
impl StatusCode
sourcepub const fn is_informational(self) -> bool
pub const fn is_informational(self) -> bool
Whether the status code is informational.
This is defined as being between [100, 200)
.
sourcepub const fn is_success(self) -> bool
pub const fn is_success(self) -> bool
Whether the status code is a success.
This is defined as being between [200, 300)
.
sourcepub const fn is_redirection(self) -> bool
pub const fn is_redirection(self) -> bool
Whether the status code is a redirection.
This is defined as being between [300, 400)
.
sourcepub const fn is_client_error(self) -> bool
pub const fn is_client_error(self) -> bool
Whether the status code is a client error.
This is defined as being between [400, 500)
.
sourcepub const fn is_server_error(self) -> bool
pub const fn is_server_error(self) -> bool
Whether the status code is a server error.
This is defined as being between [500, 600)
.
Trait Implementations§
source§impl Clone for StatusCode
impl Clone for StatusCode
source§fn clone(&self) -> StatusCode
fn clone(&self) -> StatusCode
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 StatusCode
impl Debug for StatusCode
source§impl Display for StatusCode
impl Display for StatusCode
source§impl Hash for StatusCode
impl Hash for StatusCode
source§impl Ord for StatusCode
impl Ord for StatusCode
source§fn cmp(&self, other: &StatusCode) -> Ordering
fn cmp(&self, other: &StatusCode) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<StatusCode> for u16
impl PartialEq<StatusCode> for u16
source§impl PartialEq<u16> for StatusCode
impl PartialEq<u16> for StatusCode
source§impl PartialEq for StatusCode
impl PartialEq for StatusCode
source§impl PartialOrd for StatusCode
impl PartialOrd for StatusCode
impl Copy for StatusCode
impl Eq for StatusCode
impl StructuralPartialEq for StatusCode
Auto Trait Implementations§
impl Freeze for StatusCode
impl RefUnwindSafe for StatusCode
impl Send for StatusCode
impl Sync for StatusCode
impl Unpin for StatusCode
impl UnwindSafe for StatusCode
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
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more