pub struct StatusCode(/* private fields */);Expand description
HTTP status code.
Implementations§
Source§impl StatusCode
impl StatusCode
Sourcepub const SWITCHING_PROTOCOLS: Self
pub const SWITCHING_PROTOCOLS: Self
101 Switching Protocols
Sourcepub const NO_CONTENT: Self
pub const NO_CONTENT: Self
204 No Content
Sourcepub const PARTIAL_CONTENT: Self
pub const PARTIAL_CONTENT: Self
206 Partial Content
Sourcepub const MOVED_PERMANENTLY: Self
pub const MOVED_PERMANENTLY: Self
301 Moved Permanently
Sourcepub const NOT_MODIFIED: Self
pub const NOT_MODIFIED: Self
304 Not Modified
Sourcepub const TEMPORARY_REDIRECT: Self
pub const TEMPORARY_REDIRECT: Self
307 Temporary Redirect
Sourcepub const PERMANENT_REDIRECT: Self
pub const PERMANENT_REDIRECT: Self
308 Permanent Redirect
Sourcepub const BAD_REQUEST: Self
pub const BAD_REQUEST: Self
400 Bad Request
Sourcepub const UNAUTHORIZED: Self
pub const UNAUTHORIZED: Self
401 Unauthorized
Sourcepub const METHOD_NOT_ALLOWED: Self
pub const METHOD_NOT_ALLOWED: Self
405 Method Not Allowed
Sourcepub const NOT_ACCEPTABLE: Self
pub const NOT_ACCEPTABLE: Self
406 Not Acceptable
Sourcepub const PRECONDITION_FAILED: Self
pub const PRECONDITION_FAILED: Self
412 Precondition Failed
Sourcepub const PAYLOAD_TOO_LARGE: Self
pub const PAYLOAD_TOO_LARGE: Self
413 Payload Too Large
Sourcepub const UNSUPPORTED_MEDIA_TYPE: Self
pub const UNSUPPORTED_MEDIA_TYPE: Self
415 Unsupported Media Type
Sourcepub const RANGE_NOT_SATISFIABLE: Self
pub const RANGE_NOT_SATISFIABLE: Self
416 Range Not Satisfiable
Sourcepub const UNPROCESSABLE_ENTITY: Self
pub const UNPROCESSABLE_ENTITY: Self
422 Unprocessable Entity
Sourcepub const TOO_MANY_REQUESTS: Self
pub const TOO_MANY_REQUESTS: Self
429 Too Many Requests
Sourcepub const CLIENT_CLOSED_REQUEST: Self
pub const CLIENT_CLOSED_REQUEST: Self
499 Client Closed Request
Sourcepub const INTERNAL_SERVER_ERROR: Self
pub const INTERNAL_SERVER_ERROR: Self
500 Internal Server Error
Sourcepub const SERVICE_UNAVAILABLE: Self
pub const SERVICE_UNAVAILABLE: Self
503 Service Unavailable
Sourcepub const GATEWAY_TIMEOUT: Self
pub const GATEWAY_TIMEOUT: Self
504 Gateway Timeout
Sourcepub const fn allows_body(self) -> bool
pub const fn allows_body(self) -> bool
Check if status code allows a body.
Sourcepub const fn canonical_reason(self) -> &'static str
pub const fn canonical_reason(self) -> &'static str
Get the canonical reason phrase.
Trait Implementations§
Source§impl Clone for StatusCode
impl Clone for StatusCode
Source§fn clone(&self) -> StatusCode
fn clone(&self) -> StatusCode
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 StatusCode
impl Debug for StatusCode
Source§impl Hash for StatusCode
impl Hash for StatusCode
Source§impl IntoStatusU16 for StatusCode
impl IntoStatusU16 for StatusCode
fn into_status_u16(self) -> u16
Source§impl PartialEq for StatusCode
impl PartialEq 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§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).