Struct salvo::prelude::StatusError
source · pub struct StatusError {
pub code: StatusCode,
pub name: String,
pub summary: Option<String>,
pub detail: Option<String>,
}
Expand description
StatusError contains http error information.
Fields§
§code: StatusCode
Http error status code.
name: String
Http error name.
summary: Option<String>
Summary information about http error.
detail: Option<String>
Detail information about http error.
Implementations§
source§impl StatusError
impl StatusError
sourcepub fn with_summary(self, summary: impl Into<String>) -> StatusError
pub fn with_summary(self, summary: impl Into<String>) -> StatusError
Sets summary field and returns Self.
sourcepub fn with_detail(self, detail: impl Into<String>) -> StatusError
pub fn with_detail(self, detail: impl Into<String>) -> StatusError
Sets detail field and returns Self.
sourcepub fn bad_request() -> StatusError
pub fn bad_request() -> StatusError
Create a new StatusError
.
Create a new StatusError
.
sourcepub fn payment_required() -> StatusError
pub fn payment_required() -> StatusError
Create a new StatusError
.
sourcepub fn forbidden() -> StatusError
pub fn forbidden() -> StatusError
Create a new StatusError
.
sourcepub fn not_found() -> StatusError
pub fn not_found() -> StatusError
Create a new StatusError
.
sourcepub fn method_not_allowed() -> StatusError
pub fn method_not_allowed() -> StatusError
Create a new StatusError
.
sourcepub fn not_acceptable() -> StatusError
pub fn not_acceptable() -> StatusError
Create a new StatusError
.
sourcepub fn proxy_authentication_required() -> StatusError
pub fn proxy_authentication_required() -> StatusError
Create a new StatusError
.
sourcepub fn request_timeout() -> StatusError
pub fn request_timeout() -> StatusError
Create a new StatusError
.
sourcepub fn conflict() -> StatusError
pub fn conflict() -> StatusError
Create a new StatusError
.
sourcepub fn gone() -> StatusError
pub fn gone() -> StatusError
Create a new StatusError
.
sourcepub fn length_required() -> StatusError
pub fn length_required() -> StatusError
Create a new StatusError
.
sourcepub fn precondition_failed() -> StatusError
pub fn precondition_failed() -> StatusError
Create a new StatusError
.
sourcepub fn payload_too_large() -> StatusError
pub fn payload_too_large() -> StatusError
Create a new StatusError
.
sourcepub fn uri_too_long() -> StatusError
pub fn uri_too_long() -> StatusError
Create a new StatusError
.
sourcepub fn unsupported_media_type() -> StatusError
pub fn unsupported_media_type() -> StatusError
Create a new StatusError
.
sourcepub fn range_not_satisfiable() -> StatusError
pub fn range_not_satisfiable() -> StatusError
Create a new StatusError
.
sourcepub fn expectation_failed() -> StatusError
pub fn expectation_failed() -> StatusError
Create a new StatusError
.
sourcepub fn im_a_teapot() -> StatusError
pub fn im_a_teapot() -> StatusError
Create a new StatusError
.
sourcepub fn misdirected_request() -> StatusError
pub fn misdirected_request() -> StatusError
Create a new StatusError
.
sourcepub fn unprocessable_entity() -> StatusError
pub fn unprocessable_entity() -> StatusError
Create a new StatusError
.
sourcepub fn locked() -> StatusError
pub fn locked() -> StatusError
Create a new StatusError
.
sourcepub fn failed_dependency() -> StatusError
pub fn failed_dependency() -> StatusError
Create a new StatusError
.
sourcepub fn upgrade_required() -> StatusError
pub fn upgrade_required() -> StatusError
Create a new StatusError
.
sourcepub fn precondition_required() -> StatusError
pub fn precondition_required() -> StatusError
Create a new StatusError
.
sourcepub fn too_many_requests() -> StatusError
pub fn too_many_requests() -> StatusError
Create a new StatusError
.
sourcepub fn request_header_fields_toolarge() -> StatusError
pub fn request_header_fields_toolarge() -> StatusError
Create a new StatusError
.
Create a new StatusError
.
sourcepub fn internal_server_error() -> StatusError
pub fn internal_server_error() -> StatusError
Create a new StatusError
.
sourcepub fn not_implemented() -> StatusError
pub fn not_implemented() -> StatusError
Create a new StatusError
.
sourcepub fn bad_gateway() -> StatusError
pub fn bad_gateway() -> StatusError
Create a new StatusError
.
Create a new StatusError
.
sourcepub fn gateway_timeout() -> StatusError
pub fn gateway_timeout() -> StatusError
Create a new StatusError
.
sourcepub fn http_version_not_supported() -> StatusError
pub fn http_version_not_supported() -> StatusError
Create a new StatusError
.
sourcepub fn variant_also_negotiates() -> StatusError
pub fn variant_also_negotiates() -> StatusError
Create a new StatusError
.
sourcepub fn insufficient_storage() -> StatusError
pub fn insufficient_storage() -> StatusError
Create a new StatusError
.
sourcepub fn loop_detected() -> StatusError
pub fn loop_detected() -> StatusError
Create a new StatusError
.
sourcepub fn not_extended() -> StatusError
pub fn not_extended() -> StatusError
Create a new StatusError
.
sourcepub fn network_authentication_required() -> StatusError
pub fn network_authentication_required() -> StatusError
Create a new StatusError
.
source§impl StatusError
impl StatusError
sourcepub fn from_code(code: StatusCode) -> Option<StatusError>
pub fn from_code(code: StatusCode) -> Option<StatusError>
Create new StatusError
with code. If code is not error, it will be None
.
Trait Implementations§
source§impl Debug for StatusError
impl Debug for StatusError
source§impl Display for StatusError
impl Display for StatusError
source§impl Error for StatusError
impl Error for StatusError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl Writer for StatusError
impl Writer for StatusError
source§fn write<'life0, 'life1, 'life2, 'async_trait>(
self,
_req: &'life0 mut Request,
_depot: &'life1 mut Depot,
res: &'life2 mut Response
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
StatusError: 'async_trait,
fn write<'life0, 'life1, 'life2, 'async_trait>(
self,
_req: &'life0 mut Request,
_depot: &'life1 mut Depot,
res: &'life2 mut Response
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
StatusError: 'async_trait,
Response
.