pub struct Status { /* private fields */ }
Expand description
HTTP response status.
Implementations§
Source§impl Status
impl Status
pub const CONTINUE: Self
pub const SWITCHING_PROTOCOLS: Self
pub const OK: Self
pub const CREATED: Self
pub const NO_CONTENT: Self
pub const MOVED_PERMANENTLY: Self
pub const SEE_OTHER: Self
pub const BAD_REQUEST: Self
pub const UNAUTHORIZED: Self
pub const FORBIDDEN: Self
pub const NOT_FOUND: Self
pub const METHOD_NOT_ALLOWED: Self
pub const EXPECTATION_FAILED: Self
pub const INTERNAL_SERVER_ERROR: Self
pub const NOT_IMPLEMENTED: Self
pub const BAD_GATEWAY: Self
pub const SERVICE_UNAVAILABLE: Self
pub const GATEWAY_TIMEOUT: Self
Sourcepub fn new<T>(code: u16, msg: T) -> Selfwhere
T: Into<StatusMessage>,
pub fn new<T>(code: u16, msg: T) -> Selfwhere
T: Into<StatusMessage>,
Create a new status with a given code and a message.
Sourcepub const fn from_static_str(code: u16, msg: &'static str) -> Self
pub const fn from_static_str(code: u16, msg: &'static str) -> Self
Create a new status with a given code and a message.
Sourcepub const fn from_static_bytes(code: u16, msg: &'static [u8]) -> Self
pub const fn from_static_bytes(code: u16, msg: &'static [u8]) -> Self
Create a new status with a given code and a message.
Sourcepub fn message(&self) -> &StatusMessage
pub fn message(&self) -> &StatusMessage
Get the status message.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Status
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnwindSafe for Status
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