Skip to main content

StatusWrapper

Trait StatusWrapper 

Source
pub trait StatusWrapper: Sized {
    type Inner;
    type Pure: StatusWrapper;

    const STATUS_CODE: StatusCode;

    // Required method
    fn into_inner(self) -> Self::Inner;

    // Provided method
    fn into_set<T, E>(self) -> ErrorSet<T, E>
       where E: Contains<Self::Pure>,
             Self::Inner: Into<T> { ... }
}
Expand description

Implemented for all types that can be used as E inside [ApiError<_, E>].

implemented for NotFound, InternalServerError, etc.

Required Associated Constants§

Source

const STATUS_CODE: StatusCode

The status code associated with type.

Required Associated Types§

Source

type Inner

The inner value type that is wrapped by this status wrapper.

Source

type Pure: StatusWrapper

The pure type of this status wrapper, without any inner value.

Required Methods§

Source

fn into_inner(self) -> Self::Inner

Convert this status wrapper into its inner value.

Provided Methods§

Source

fn into_set<T, E>(self) -> ErrorSet<T, E>
where E: Contains<Self::Pure>, Self::Inner: Into<T>,

Convert this status wrapper into an ErrorSet with the given inner value type. (into can be used as well)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> StatusWrapper for BadGateway<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::BAD_GATEWAY

Source§

type Inner = T

Source§

type Pure = BadGateway

Source§

impl<T> StatusWrapper for BadRequest<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::BAD_REQUEST

Source§

type Inner = T

Source§

type Pure = BadRequest

Source§

impl<T> StatusWrapper for Conflict<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::CONFLICT

Source§

type Inner = T

Source§

type Pure = Conflict

Source§

impl<T> StatusWrapper for ExpectationFailed<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::EXPECTATION_FAILED

Source§

type Inner = T

Source§

type Pure = ExpectationFailed

Source§

impl<T> StatusWrapper for FailedDependency<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::FAILED_DEPENDENCY

Source§

type Inner = T

Source§

type Pure = FailedDependency

Source§

impl<T> StatusWrapper for Forbidden<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::FORBIDDEN

Source§

type Inner = T

Source§

type Pure = Forbidden

Source§

impl<T> StatusWrapper for GatewayTimeout<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::GATEWAY_TIMEOUT

Source§

type Inner = T

Source§

type Pure = GatewayTimeout

Source§

impl<T> StatusWrapper for Gone<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::GONE

Source§

type Inner = T

Source§

type Pure = Gone

Source§

impl<T> StatusWrapper for HttpVersionNotSupported<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::HTTP_VERSION_NOT_SUPPORTED

Source§

type Inner = T

Source§

type Pure = HttpVersionNotSupported

Source§

impl<T> StatusWrapper for ImATeapot<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::IM_A_TEAPOT

Source§

type Inner = T

Source§

type Pure = ImATeapot

Source§

impl<T> StatusWrapper for InsufficientStorage<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::INSUFFICIENT_STORAGE

Source§

type Inner = T

Source§

type Pure = InsufficientStorage

Source§

impl<T> StatusWrapper for InternalServerError<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::INTERNAL_SERVER_ERROR

Source§

type Inner = T

Source§

type Pure = InternalServerError

Source§

impl<T> StatusWrapper for LengthRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::LENGTH_REQUIRED

Source§

type Inner = T

Source§

type Pure = LengthRequired

Source§

impl<T> StatusWrapper for Locked<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::LOCKED

Source§

type Inner = T

Source§

type Pure = Locked

Source§

impl<T> StatusWrapper for LoopDetected<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::LOOP_DETECTED

Source§

type Inner = T

Source§

type Pure = LoopDetected

Source§

impl<T> StatusWrapper for MethodNotAllowed<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::METHOD_NOT_ALLOWED

Source§

type Inner = T

Source§

type Pure = MethodNotAllowed

Source§

impl<T> StatusWrapper for MisdirectedRequest<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::MISDIRECTED_REQUEST

Source§

type Inner = T

Source§

type Pure = MisdirectedRequest

Source§

impl<T> StatusWrapper for NetworkAuthenticationRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NETWORK_AUTHENTICATION_REQUIRED

Source§

type Inner = T

Source§

type Pure = NetworkAuthenticationRequired

Source§

impl<T> StatusWrapper for NotAcceptable<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NOT_ACCEPTABLE

Source§

type Inner = T

Source§

type Pure = NotAcceptable

Source§

impl<T> StatusWrapper for NotExtended<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NOT_EXTENDED

Source§

type Inner = T

Source§

type Pure = NotExtended

Source§

impl<T> StatusWrapper for NotFound<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NOT_FOUND

Source§

type Inner = T

Source§

type Pure = NotFound

Source§

impl<T> StatusWrapper for NotImplemented<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NOT_IMPLEMENTED

Source§

type Inner = T

Source§

type Pure = NotImplemented

Source§

impl<T> StatusWrapper for PaymentRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::PAYMENT_REQUIRED

Source§

type Inner = T

Source§

type Pure = PaymentRequired

Source§

impl<T> StatusWrapper for PreconditionFailed<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::PRECONDITION_FAILED

Source§

type Inner = T

Source§

type Pure = PreconditionFailed

Source§

impl<T> StatusWrapper for PreconditionRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::PRECONDITION_REQUIRED

Source§

type Inner = T

Source§

type Pure = PreconditionRequired

Source§

impl<T> StatusWrapper for ProxyAuthenticationRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::PROXY_AUTHENTICATION_REQUIRED

Source§

type Inner = T

Source§

type Pure = ProxyAuthenticationRequired

Source§

impl<T> StatusWrapper for RangeNotSatisfiable<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::RANGE_NOT_SATISFIABLE

Source§

type Inner = T

Source§

type Pure = RangeNotSatisfiable

Source§

impl<T> StatusWrapper for RequestHeaderFieldsTooLarge<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::REQUEST_HEADER_FIELDS_TOO_LARGE

Source§

type Inner = T

Source§

type Pure = RequestHeaderFieldsTooLarge

Source§

impl<T> StatusWrapper for RequestTimeout<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::REQUEST_TIMEOUT

Source§

type Inner = T

Source§

type Pure = RequestTimeout

Source§

impl<T> StatusWrapper for ServiceUnavailable<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::SERVICE_UNAVAILABLE

Source§

type Inner = T

Source§

type Pure = ServiceUnavailable

Source§

impl<T> StatusWrapper for TooManyRequests<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::TOO_MANY_REQUESTS

Source§

type Inner = T

Source§

type Pure = TooManyRequests

Source§

impl<T> StatusWrapper for Unauthorized<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UNAUTHORIZED

Source§

type Inner = T

Source§

type Pure = Unauthorized

Source§

impl<T> StatusWrapper for UnavailableForLegalReasons<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UNAVAILABLE_FOR_LEGAL_REASONS

Source§

type Inner = T

Source§

type Pure = UnavailableForLegalReasons

Source§

impl<T> StatusWrapper for UnprocessableEntity<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UNPROCESSABLE_ENTITY

Source§

type Inner = T

Source§

type Pure = UnprocessableEntity

Source§

impl<T> StatusWrapper for UnsupportedMediaType<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UNSUPPORTED_MEDIA_TYPE

Source§

type Inner = T

Source§

type Pure = UnsupportedMediaType

Source§

impl<T> StatusWrapper for UpgradeRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UPGRADE_REQUIRED

Source§

type Inner = T

Source§

type Pure = UpgradeRequired

Source§

impl<T> StatusWrapper for UriTooLong<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::URI_TOO_LONG

Source§

type Inner = T

Source§

type Pure = UriTooLong

Source§

impl<T> StatusWrapper for VariantAlsoNegotiates<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::VARIANT_ALSO_NEGOTIATES

Source§

type Inner = T

Source§

type Pure = VariantAlsoNegotiates