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
sourceimpl StatusError
impl StatusError
sourcepub fn with_summary(self, summary: impl Into<String>) -> StatusError
pub fn with_summary(self, summary: impl Into<String>) -> StatusError
Set 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
Set 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
.
sourceimpl 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
sourceimpl Debug for StatusError
impl Debug for StatusError
sourceimpl Display for StatusError
impl Display for StatusError
sourceimpl Error for StatusError
impl Error for StatusError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<StatusError> for Error
impl From<StatusError> for Error
sourcefn from(err: StatusError) -> Error
fn from(err: StatusError) -> Error
Converts to this type from the input type.
sourceimpl Writer for StatusError
impl Writer for StatusError
sourcefn 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,
Write data to Respone
.
Auto Trait Implementations
impl RefUnwindSafe for StatusError
impl Send for StatusError
impl Sync for StatusError
impl Unpin for StatusError
impl UnwindSafe for StatusError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more