pub struct KnownWebError { /* private fields */ }Expand description
Implementations§
Source§impl KnownWebError
 
impl KnownWebError
pub fn new<S: Into<String>>(status_code: StatusCode, msg: S) -> Self
Sourcepub fn ok<S: Into<String>>(msg: S) -> Self
 
pub fn ok<S: Into<String>>(msg: S) -> Self
200 OK [RFC7231, Section 6.3.1]
Sourcepub fn created<S: Into<String>>(msg: S) -> Self
 
pub fn created<S: Into<String>>(msg: S) -> Self
201 Created [RFC7231, Section 6.3.2]
Sourcepub fn accepted<S: Into<String>>(msg: S) -> Self
 
pub fn accepted<S: Into<String>>(msg: S) -> Self
202 Accepted [RFC7231, Section 6.3.3]
203 Non-Authoritative Information [RFC7231, Section 6.3.4]
Sourcepub fn no_content<S: Into<String>>(msg: S) -> Self
 
pub fn no_content<S: Into<String>>(msg: S) -> Self
204 No Content [RFC7231, Section 6.3.5]
Sourcepub fn reset_content<S: Into<String>>(msg: S) -> Self
 
pub fn reset_content<S: Into<String>>(msg: S) -> Self
205 Reset Content [RFC7231, Section 6.3.6]
Sourcepub fn partial_content<S: Into<String>>(msg: S) -> Self
 
pub fn partial_content<S: Into<String>>(msg: S) -> Self
206 Partial Content [RFC7233, Section 4.1]
Sourcepub fn multi_status<S: Into<String>>(msg: S) -> Self
 
pub fn multi_status<S: Into<String>>(msg: S) -> Self
207 Multi-Status [RFC4918]
Sourcepub fn already_reported<S: Into<String>>(msg: S) -> Self
 
pub fn already_reported<S: Into<String>>(msg: S) -> Self
208 Already Reported [RFC5842]
Sourcepub fn multiple_choices<S: Into<String>>(msg: S) -> Self
 
pub fn multiple_choices<S: Into<String>>(msg: S) -> Self
300 Multiple Choices [RFC7231, Section 6.4.1]
Sourcepub fn moved_permanently<S: Into<String>>(msg: S) -> Self
 
pub fn moved_permanently<S: Into<String>>(msg: S) -> Self
301 Moved Permanently [RFC7231, Section 6.4.2]
Sourcepub fn found<S: Into<String>>(msg: S) -> Self
 
pub fn found<S: Into<String>>(msg: S) -> Self
302 Found [RFC7231, Section 6.4.3]
Sourcepub fn see_other<S: Into<String>>(msg: S) -> Self
 
pub fn see_other<S: Into<String>>(msg: S) -> Self
303 See Other [RFC7231, Section 6.4.4]
Sourcepub fn not_modified<S: Into<String>>(msg: S) -> Self
 
pub fn not_modified<S: Into<String>>(msg: S) -> Self
304 Not Modified [RFC7232, Section 4.1]
Sourcepub fn use_proxy<S: Into<String>>(msg: S) -> Self
 
pub fn use_proxy<S: Into<String>>(msg: S) -> Self
305 Use Proxy [RFC7231, Section 6.4.5]
Sourcepub fn temporary_redirect<S: Into<String>>(msg: S) -> Self
 
pub fn temporary_redirect<S: Into<String>>(msg: S) -> Self
307 Temporary Redirect [RFC7231, Section 6.4.7]
Sourcepub fn permanent_redirect<S: Into<String>>(msg: S) -> Self
 
pub fn permanent_redirect<S: Into<String>>(msg: S) -> Self
308 Permanent Redirect [RFC7238]
Sourcepub fn bad_request<S: Into<String>>(msg: S) -> Self
 
pub fn bad_request<S: Into<String>>(msg: S) -> Self
400 Bad Request [RFC7231, Section 6.5.1]
401 Unauthorized [RFC7235, Section 3.1]
Sourcepub fn payment_required<S: Into<String>>(msg: S) -> Self
 
pub fn payment_required<S: Into<String>>(msg: S) -> Self
402 Payment Required [RFC7231, Section 6.5.2]
Sourcepub fn forbidden<S: Into<String>>(msg: S) -> Self
 
pub fn forbidden<S: Into<String>>(msg: S) -> Self
403 Forbidden [RFC7231, Section 6.5.3]
Sourcepub fn not_found<S: Into<String>>(msg: S) -> Self
 
pub fn not_found<S: Into<String>>(msg: S) -> Self
404 Not Found [RFC7231, Section 6.5.4]
Sourcepub fn method_not_allowed<S: Into<String>>(msg: S) -> Self
 
pub fn method_not_allowed<S: Into<String>>(msg: S) -> Self
405 Method Not Allowed [RFC7231, Section 6.5.5]
Sourcepub fn not_acceptable<S: Into<String>>(msg: S) -> Self
 
pub fn not_acceptable<S: Into<String>>(msg: S) -> Self
406 Not Acceptable [RFC7231, Section 6.5.6]
Sourcepub fn proxy_authentication_required<S: Into<String>>(msg: S) -> Self
 
pub fn proxy_authentication_required<S: Into<String>>(msg: S) -> Self
407 Proxy Authentication Required [RFC7235, Section 3.2]
Sourcepub fn request_timeout<S: Into<String>>(msg: S) -> Self
 
pub fn request_timeout<S: Into<String>>(msg: S) -> Self
408 Request Timeout [RFC7231, Section 6.5.7]
Sourcepub fn conflict<S: Into<String>>(msg: S) -> Self
 
pub fn conflict<S: Into<String>>(msg: S) -> Self
409 Conflict [RFC7231, Section 6.5.8]
Sourcepub fn gone<S: Into<String>>(msg: S) -> Self
 
pub fn gone<S: Into<String>>(msg: S) -> Self
410 Gone [RFC7231, Section 6.5.9]
Sourcepub fn length_required<S: Into<String>>(msg: S) -> Self
 
pub fn length_required<S: Into<String>>(msg: S) -> Self
411 Length Required [RFC7231, Section 6.5.10]
Sourcepub fn precondition_failed<S: Into<String>>(msg: S) -> Self
 
pub fn precondition_failed<S: Into<String>>(msg: S) -> Self
412 Precondition Failed [RFC7232, Section 4.2]
Sourcepub fn payload_too_large<S: Into<String>>(msg: S) -> Self
 
pub fn payload_too_large<S: Into<String>>(msg: S) -> Self
413 Payload Too Large [RFC7231, Section 6.5.11]
Sourcepub fn uri_too_long<S: Into<String>>(msg: S) -> Self
 
pub fn uri_too_long<S: Into<String>>(msg: S) -> Self
414 URI Too Long [RFC7231, Section 6.5.12]
Sourcepub fn unsupported_media_type<S: Into<String>>(msg: S) -> Self
 
pub fn unsupported_media_type<S: Into<String>>(msg: S) -> Self
415 Unsupported Media Type [RFC7231, Section 6.5.13]
Sourcepub fn range_not_satisfiable<S: Into<String>>(msg: S) -> Self
 
pub fn range_not_satisfiable<S: Into<String>>(msg: S) -> Self
416 Range Not Satisfiable [RFC7233, Section 4.4]
Sourcepub fn expectation_failed<S: Into<String>>(msg: S) -> Self
 
pub fn expectation_failed<S: Into<String>>(msg: S) -> Self
417 Expectation Failed [RFC7231, Section 6.5.14]
Sourcepub fn im_a_teapot<S: Into<String>>(msg: S) -> Self
 
pub fn im_a_teapot<S: Into<String>>(msg: S) -> Self
418 I’m a teapot [curiously not registered by IANA but RFC2324]
Sourcepub fn misdirected_request<S: Into<String>>(msg: S) -> Self
 
pub fn misdirected_request<S: Into<String>>(msg: S) -> Self
421 Misdirected Request RFC7540, Section 9.1.2
Sourcepub fn unprocessable_entity<S: Into<String>>(msg: S) -> Self
 
pub fn unprocessable_entity<S: Into<String>>(msg: S) -> Self
422 Unprocessable Entity [RFC4918]
Sourcepub fn failed_dependency<S: Into<String>>(msg: S) -> Self
 
pub fn failed_dependency<S: Into<String>>(msg: S) -> Self
424 Failed Dependency [RFC4918]
Sourcepub fn upgrade_required<S: Into<String>>(msg: S) -> Self
 
pub fn upgrade_required<S: Into<String>>(msg: S) -> Self
426 Upgrade Required [RFC7231, Section 6.5.15]
Sourcepub fn precondition_required<S: Into<String>>(msg: S) -> Self
 
pub fn precondition_required<S: Into<String>>(msg: S) -> Self
428 Precondition Required [RFC6585]
Sourcepub fn too_many_requests<S: Into<String>>(msg: S) -> Self
 
pub fn too_many_requests<S: Into<String>>(msg: S) -> Self
429 Too Many Requests [RFC6585]
Sourcepub fn request_header_fields_too_large<S: Into<String>>(msg: S) -> Self
 
pub fn request_header_fields_too_large<S: Into<String>>(msg: S) -> Self
431 Request Header Fields Too Large [RFC6585]
451 Unavailable For Legal Reasons [RFC7725]
Sourcepub fn internal_server_error<S: Into<String>>(msg: S) -> Self
 
pub fn internal_server_error<S: Into<String>>(msg: S) -> Self
500 Internal Server Error [RFC7231, Section 6.6.1]
Sourcepub fn not_implemented<S: Into<String>>(msg: S) -> Self
 
pub fn not_implemented<S: Into<String>>(msg: S) -> Self
501 Not Implemented [RFC7231, Section 6.6.2]
Sourcepub fn bad_gateway<S: Into<String>>(msg: S) -> Self
 
pub fn bad_gateway<S: Into<String>>(msg: S) -> Self
502 Bad Gateway [RFC7231, Section 6.6.3]
503 Service Unavailable [RFC7231, Section 6.6.4]
Sourcepub fn gateway_timeout<S: Into<String>>(msg: S) -> Self
 
pub fn gateway_timeout<S: Into<String>>(msg: S) -> Self
504 Gateway Timeout [RFC7231, Section 6.6.5]
Sourcepub fn http_version_not_supported<S: Into<String>>(msg: S) -> Self
 
pub fn http_version_not_supported<S: Into<String>>(msg: S) -> Self
505 HTTP Version Not Supported [RFC7231, Section 6.6.6]
Sourcepub fn variant_also_negotiates<S: Into<String>>(msg: S) -> Self
 
pub fn variant_also_negotiates<S: Into<String>>(msg: S) -> Self
506 Variant Also Negotiates [RFC2295]
Sourcepub fn insufficient_storage<S: Into<String>>(msg: S) -> Self
 
pub fn insufficient_storage<S: Into<String>>(msg: S) -> Self
507 Insufficient Storage [RFC4918]
Sourcepub fn loop_detected<S: Into<String>>(msg: S) -> Self
 
pub fn loop_detected<S: Into<String>>(msg: S) -> Self
508 Loop Detected [RFC5842]
Sourcepub fn not_extended<S: Into<String>>(msg: S) -> Self
 
pub fn not_extended<S: Into<String>>(msg: S) -> Self
510 Not Extended [RFC2774]
Sourcepub fn network_authentication_required<S: Into<String>>(msg: S) -> Self
 
pub fn network_authentication_required<S: Into<String>>(msg: S) -> Self
511 Network Authentication Required [RFC6585]
Trait Implementations§
Source§impl Debug for KnownWebError
 
impl Debug for KnownWebError
Source§impl Display for KnownWebError
 
impl Display for KnownWebError
Source§impl Error for KnownWebError
 
impl Error for KnownWebError
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 From<KnownWebError> for WebError
 
impl From<KnownWebError> for WebError
Source§fn from(source: KnownWebError) -> Self
 
fn from(source: KnownWebError) -> Self
Auto Trait Implementations§
impl Freeze for KnownWebError
impl RefUnwindSafe for KnownWebError
impl Send for KnownWebError
impl Sync for KnownWebError
impl Unpin for KnownWebError
impl UnwindSafe for KnownWebError
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
Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<E> InstrumentError for Ewhere
    TracedError<E>: From<E>,
 
impl<E> InstrumentError for Ewhere
    TracedError<E>: From<E>,
Source§type Instrumented = TracedError<E>
 
type Instrumented = TracedError<E>
Source§fn in_current_span(self) -> <E as InstrumentError>::Instrumented
 
fn in_current_span(self) -> <E as InstrumentError>::Instrumented
Source§impl<T> PolicyExt for Twhere
    T: ?Sized,
 
impl<T> PolicyExt for Twhere
    T: ?Sized,
Source§impl<T> ServiceExt for T
 
impl<T> ServiceExt for T
Source§fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
    Self: Sized,
 
fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
    Self: Sized,
Source§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
    Self: Sized,
 
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
    Self: Sized,
Source§fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
    Self: Sized,
 
fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
    Self: Sized,
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
    Self: Sized,
 
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
    Self: Sized,
Source§fn compression(self) -> Compression<Self>where
    Self: Sized,
 
fn compression(self) -> Compression<Self>where
    Self: Sized,
Source§fn decompression(self) -> Decompression<Self>where
    Self: Sized,
 
fn decompression(self) -> Decompression<Self>where
    Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
    Self: Sized,
 
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
    Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
    Self: Sized,
 
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
    Self: Sized,
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
    Self: Sized,
 
fn follow_redirects(self) -> FollowRedirect<Self>where
    Self: Sized,
Source§fn sensitive_headers(
    self,
    headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
    Self: Sized,
 
fn sensitive_headers(
    self,
    headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
    Self: Sized,
Source§fn sensitive_request_headers(
    self,
    headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
    Self: Sized,
 
fn sensitive_request_headers(
    self,
    headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
    Self: Sized,
Source§fn sensitive_response_headers(
    self,
    headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
    Self: Sized,
 
fn sensitive_response_headers(
    self,
    headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
    Self: Sized,
Source§fn override_request_header<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetRequestHeader<Self, M>where
    Self: Sized,
 
fn override_request_header<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetRequestHeader<Self, M>where
    Self: Sized,
Source§fn append_request_header<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetRequestHeader<Self, M>where
    Self: Sized,
 
fn append_request_header<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetRequestHeader<Self, M>where
    Self: Sized,
Source§fn insert_request_header_if_not_present<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetRequestHeader<Self, M>where
    Self: Sized,
 
fn insert_request_header_if_not_present<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetRequestHeader<Self, M>where
    Self: Sized,
Source§fn override_response_header<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetResponseHeader<Self, M>where
    Self: Sized,
 
fn override_response_header<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetResponseHeader<Self, M>where
    Self: Sized,
Source§fn append_response_header<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetResponseHeader<Self, M>where
    Self: Sized,
 
fn append_response_header<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetResponseHeader<Self, M>where
    Self: Sized,
Source§fn insert_response_header_if_not_present<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetResponseHeader<Self, M>where
    Self: Sized,
 
fn insert_response_header_if_not_present<M>(
    self,
    header_name: HeaderName,
    make: M,
) -> SetResponseHeader<Self, M>where
    Self: Sized,
Source§fn set_request_id<M>(
    self,
    header_name: HeaderName,
    make_request_id: M,
) -> SetRequestId<Self, M>where
    Self: Sized,
    M: MakeRequestId,
 
fn set_request_id<M>(
    self,
    header_name: HeaderName,
    make_request_id: M,
) -> SetRequestId<Self, M>where
    Self: Sized,
    M: MakeRequestId,
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
    Self: Sized,
    M: MakeRequestId,
 
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
    Self: Sized,
    M: MakeRequestId,
x-request-id as the header name. Read moreSource§fn propagate_request_id(
    self,
    header_name: HeaderName,
) -> PropagateRequestId<Self>where
    Self: Sized,
 
fn propagate_request_id(
    self,
    header_name: HeaderName,
) -> PropagateRequestId<Self>where
    Self: Sized,
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
    Self: Sized,
 
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
    Self: Sized,
x-request-id as the header name. Read moreSource§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
    Self: Sized,
 
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
    Self: Sized,
500 Internal Server responses. Read moreSource§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
    Self: Sized,
 
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
    Self: Sized,
413 Payload Too Large responses. Read moreSource§fn trim_trailing_slash(self) -> NormalizePath<Self>where
    Self: Sized,
 
fn trim_trailing_slash(self) -> NormalizePath<Self>where
    Self: Sized,
Source§fn append_trailing_slash(self) -> NormalizePath<Self>where
    Self: Sized,
 
fn append_trailing_slash(self) -> NormalizePath<Self>where
    Self: Sized,
Source§impl<T> ToStringFallible for Twhere
    T: Display,
 
impl<T> ToStringFallible for Twhere
    T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
 
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.