Struct spring_web::error::KnownWebError

source ·
pub struct KnownWebError { /* private fields */ }
Expand description

Implementations§

source§

impl KnownWebError

source

pub fn new(status_code: StatusCode, msg: &str) -> Self

source

pub fn ok(msg: &str) -> Self

source

pub fn created(msg: &str) -> Self

201 Created [RFC7231, Section 6.3.2]

source

pub fn accepted(msg: &str) -> Self

202 Accepted [RFC7231, Section 6.3.3]

source

pub fn non_authoritative_information(msg: &str) -> Self

203 Non-Authoritative Information [RFC7231, Section 6.3.4]

source

pub fn no_content(msg: &str) -> Self

204 No Content [RFC7231, Section 6.3.5]

source

pub fn reset_content(msg: &str) -> Self

205 Reset Content [RFC7231, Section 6.3.6]

source

pub fn partial_content(msg: &str) -> Self

206 Partial Content [RFC7233, Section 4.1]

source

pub fn multi_status(msg: &str) -> Self

207 Multi-Status [RFC4918]

source

pub fn already_reported(msg: &str) -> Self

208 Already Reported [RFC5842]

source

pub fn im_used(msg: &str) -> Self

226 IM Used [RFC3229]

source

pub fn multiple_choices(msg: &str) -> Self

300 Multiple Choices [RFC7231, Section 6.4.1]

source

pub fn moved_permanently(msg: &str) -> Self

301 Moved Permanently [RFC7231, Section 6.4.2]

source

pub fn found(msg: &str) -> Self

source

pub fn see_other(msg: &str) -> Self

303 See Other [RFC7231, Section 6.4.4]

source

pub fn not_modified(msg: &str) -> Self

304 Not Modified [RFC7232, Section 4.1]

source

pub fn use_proxy(msg: &str) -> Self

305 Use Proxy [RFC7231, Section 6.4.5]

source

pub fn temporary_redirect(msg: &str) -> Self

307 Temporary Redirect [RFC7231, Section 6.4.7]

source

pub fn permanent_redirect(msg: &str) -> Self

308 Permanent Redirect [RFC7238]

source

pub fn bad_request(msg: &str) -> Self

400 Bad Request [RFC7231, Section 6.5.1]

source

pub fn unauthorized(msg: &str) -> Self

401 Unauthorized [RFC7235, Section 3.1]

source

pub fn payment_required(msg: &str) -> Self

402 Payment Required [RFC7231, Section 6.5.2]

source

pub fn forbidden(msg: &str) -> Self

403 Forbidden [RFC7231, Section 6.5.3]

source

pub fn not_found(msg: &str) -> Self

404 Not Found [RFC7231, Section 6.5.4]

source

pub fn method_not_allowed(msg: &str) -> Self

405 Method Not Allowed [RFC7231, Section 6.5.5]

source

pub fn not_acceptable(msg: &str) -> Self

406 Not Acceptable [RFC7231, Section 6.5.6]

source

pub fn proxy_authentication_required(msg: &str) -> Self

407 Proxy Authentication Required [RFC7235, Section 3.2]

source

pub fn request_timeout(msg: &str) -> Self

408 Request Timeout [RFC7231, Section 6.5.7]

source

pub fn conflict(msg: &str) -> Self

409 Conflict [RFC7231, Section 6.5.8]

source

pub fn gone(msg: &str) -> Self

source

pub fn length_required(msg: &str) -> Self

411 Length Required [RFC7231, Section 6.5.10]

source

pub fn precondition_failed(msg: &str) -> Self

412 Precondition Failed [RFC7232, Section 4.2]

source

pub fn payload_too_large(msg: &str) -> Self

413 Payload Too Large [RFC7231, Section 6.5.11]

source

pub fn uri_too_long(msg: &str) -> Self

414 URI Too Long [RFC7231, Section 6.5.12]

source

pub fn unsupported_media_type(msg: &str) -> Self

415 Unsupported Media Type [RFC7231, Section 6.5.13]

source

pub fn range_not_satisfiable(msg: &str) -> Self

416 Range Not Satisfiable [RFC7233, Section 4.4]

source

pub fn expectation_failed(msg: &str) -> Self

417 Expectation Failed [RFC7231, Section 6.5.14]

source

pub fn im_a_teapot(msg: &str) -> Self

418 I’m a teapot [curiously not registered by IANA but RFC2324]

source

pub fn misdirected_request(msg: &str) -> Self

421 Misdirected Request RFC7540, Section 9.1.2

source

pub fn unprocessable_entity(msg: &str) -> Self

422 Unprocessable Entity [RFC4918]

source

pub fn locked(msg: &str) -> Self

423 Locked [RFC4918]

source

pub fn failed_dependency(msg: &str) -> Self

424 Failed Dependency [RFC4918]

source

pub fn upgrade_required(msg: &str) -> Self

426 Upgrade Required [RFC7231, Section 6.5.15]

source

pub fn precondition_required(msg: &str) -> Self

428 Precondition Required [RFC6585]

source

pub fn too_many_requests(msg: &str) -> Self

429 Too Many Requests [RFC6585]

source

pub fn request_header_fields_too_large(msg: &str) -> Self

431 Request Header Fields Too Large [RFC6585]

451 Unavailable For Legal Reasons [RFC7725]

source

pub fn internal_server_error(msg: &str) -> Self

500 Internal Server Error [RFC7231, Section 6.6.1]

source

pub fn not_implemented(msg: &str) -> Self

501 Not Implemented [RFC7231, Section 6.6.2]

source

pub fn bad_gateway(msg: &str) -> Self

502 Bad Gateway [RFC7231, Section 6.6.3]

source

pub fn service_unavailable(msg: &str) -> Self

503 Service Unavailable [RFC7231, Section 6.6.4]

source

pub fn gateway_timeout(msg: &str) -> Self

504 Gateway Timeout [RFC7231, Section 6.6.5]

source

pub fn http_version_not_supported(msg: &str) -> Self

505 HTTP Version Not Supported [RFC7231, Section 6.6.6]

source

pub fn variant_also_negotiates(msg: &str) -> Self

506 Variant Also Negotiates [RFC2295]

source

pub fn insufficient_storage(msg: &str) -> Self

507 Insufficient Storage [RFC4918]

source

pub fn loop_detected(msg: &str) -> Self

508 Loop Detected [RFC5842]

source

pub fn not_extended(msg: &str) -> Self

510 Not Extended [RFC2774]

source

pub fn network_authentication_required(msg: &str) -> Self

511 Network Authentication Required [RFC6585]

Trait Implementations§

source§

impl Debug for KnownWebError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for KnownWebError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for KnownWebError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
source§

impl From<KnownWebError> for WebError

source§

fn from(source: KnownWebError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> PolicyExt for T
where T: ?Sized,

source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T> ToStringFallible for T
where T: Display,

source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,