pub struct HttpStatus(pub u16);Expand description
HTTP status code.
Tuple Fields§
§0: u16Implementations§
Source§impl HttpStatus
impl HttpStatus
pub const OK: HttpStatus
pub const ACCEPTED: HttpStatus
pub const BAD_REQUEST: HttpStatus
pub const UNAUTHORIZED: HttpStatus
pub const FORBIDDEN: HttpStatus
pub const NOT_FOUND: HttpStatus
pub const METHOD_NOT_ALLOWED: HttpStatus
pub const INTERNAL_SERVER_ERROR: HttpStatus
pub const SERVICE_UNAVAILABLE: HttpStatus
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if this is a success status (2xx).
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Returns true if this is a client error (4xx).
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Returns true if this is a server error (5xx).
Trait Implementations§
Source§impl Clone for HttpStatus
impl Clone for HttpStatus
Source§fn clone(&self) -> HttpStatus
fn clone(&self) -> HttpStatus
Returns a duplicate 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 HttpStatus
impl Debug for HttpStatus
Source§impl PartialEq for HttpStatus
impl PartialEq for HttpStatus
impl Copy for HttpStatus
impl Eq for HttpStatus
impl StructuralPartialEq for HttpStatus
Auto Trait Implementations§
impl Freeze for HttpStatus
impl RefUnwindSafe for HttpStatus
impl Send for HttpStatus
impl Sync for HttpStatus
impl Unpin for HttpStatus
impl UnwindSafe for HttpStatus
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).