pub struct StatusCode {
pub kind: StatusCodeKind,
pub code: u16,
}Expand description
Contains a StatusCodeKind and the corresponding code for it, this is useful on generating error messages and validity of a particular code.
Fields§
§kind: StatusCodeKindThe StatusCodeKind
code: u16The integer representing the status code
Implementations§
Source§impl StatusCode
impl StatusCode
Sourcepub fn parse(text: &str) -> Self
pub fn parse(text: &str) -> Self
Parse a server response into a StatusCode struct.
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Returns whether a status code number is a failure.
Trait Implementations§
Source§impl Debug for StatusCode
impl Debug for StatusCode
Source§impl PartialEq for StatusCode
impl PartialEq 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