pub struct RoutingError { /* private fields */ }Expand description
A schema-mode routing rejection: a RoutingErrorKind plus an optional diagnostic
source that never reaches the wire.
Implementations§
Source§impl RoutingError
impl RoutingError
Sourcepub fn unknown_operation() -> Self
pub fn unknown_operation() -> Self
A rejection naming no operation the service serves.
Sourcepub fn method_not_allowed() -> Self
pub fn method_not_allowed() -> Self
A rejection for a URI whose matched operations accept a different method.
Sourcepub fn malformed(source: impl Error + Send + Sync + 'static) -> Self
pub fn malformed(source: impl Error + Send + Sync + 'static) -> Self
A rejection for a request that violates the protocol’s framing rules; source names
the violation for logs.
Sourcepub fn unsupported_operation() -> Self
pub fn unsupported_operation() -> Self
A rejection for a known operation whose features the protocol does not support.
Sourcepub fn missing_content_type(expected: &'static str) -> Self
pub fn missing_content_type(expected: &'static str) -> Self
A missing Content-Type for an input that requires body data.
Sourcepub fn expected_content_type(&self) -> Option<&'static str>
pub fn expected_content_type(&self) -> Option<&'static str>
The expected media type for a missing-content-type rejection.
Sourcepub fn with_source(self, source: impl Error + Send + Sync + 'static) -> Self
pub fn with_source(self, source: impl Error + Send + Sync + 'static) -> Self
Attaches a diagnostic source.
Sourcepub fn kind(&self) -> RoutingErrorKind
pub fn kind(&self) -> RoutingErrorKind
Returns the routing-semantic classification.
Trait Implementations§
Source§impl Debug for RoutingError
impl Debug for RoutingError
Source§impl Display for RoutingError
impl Display for RoutingError
Source§impl Error for RoutingError
impl Error for RoutingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl HttpModeledError for RoutingError
impl HttpModeledError for RoutingError
Source§fn status_code(&self) -> u16
fn status_code(&self) -> u16
The HTTP status code for this error:
@httpError when present, otherwise 400 for
@error("client") shapes and 500 for @error("server") shapes.Source§fn operation_schema(&self) -> Option<&OperationSchema<'_>>
fn operation_schema(&self) -> Option<&OperationSchema<'_>>
The operation that returned this error, when known. Read more
Source§impl SerializableStruct for RoutingError
impl SerializableStruct for RoutingError
Auto Trait Implementations§
impl Freeze for RoutingError
impl !RefUnwindSafe for RoutingError
impl Send for RoutingError
impl Sync for RoutingError
impl Unpin for RoutingError
impl UnsafeUnpin for RoutingError
impl !UnwindSafe for RoutingError
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.