pub trait StatusCode {
// Required methods
fn is_http_ok(&self) -> bool;
fn is_http_err(&self) -> bool;
fn is_user_err(&self) -> bool;
fn is_server_err(&self) -> bool;
fn status_msg(&self) -> &'static str;
}
Required Methods§
Sourcefn is_http_ok(&self) -> bool
fn is_http_ok(&self) -> bool
Returns true if the status code of the request represents an OK status (200-300)
Sourcefn is_http_err(&self) -> bool
fn is_http_err(&self) -> bool
Returns true if the status code of the request doesn’t represent an OK status (200-300)
Sourcefn is_user_err(&self) -> bool
fn is_user_err(&self) -> bool
Returns true if the status code indicates am user error (4XX)
Sourcefn is_server_err(&self) -> bool
fn is_server_err(&self) -> bool
Returns true if the status code indicates a server error (5XX)
Sourcefn status_msg(&self) -> &'static str
fn status_msg(&self) -> &'static str
Get a human-readable description of the request’s status code