Skip to main content

WrapsResponse

Trait WrapsResponse 

Source
pub trait WrapsResponse: Sized {
    type Inner;
    type Pure: WrapsResponse<Inner = ()>;

    const STATUS_CODE: StatusCode;

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

    // Provided method
    fn into_set<E>(self) -> ApiResponse<E>
       where Self::Inner: IntoResponse,
             E: Contains<Self> { ... }
}

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: WrapsResponse<Inner = ()>

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<E>(self) -> ApiResponse<E>
where Self::Inner: IntoResponse, E: Contains<Self>,

Convert this status wrapper into an [ApiErrorSet] 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> WrapsResponse for BadGateway<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::BAD_GATEWAY

Source§

type Inner = T

Source§

type Pure = BadGateway

Source§

impl<T> WrapsResponse for BadRequest<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::BAD_REQUEST

Source§

type Inner = T

Source§

type Pure = BadRequest

Source§

impl<T> WrapsResponse for Conflict<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::CONFLICT

Source§

type Inner = T

Source§

type Pure = Conflict

Source§

impl<T> WrapsResponse for ExpectationFailed<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::EXPECTATION_FAILED

Source§

type Inner = T

Source§

type Pure = ExpectationFailed

Source§

impl<T> WrapsResponse for FailedDependency<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::FAILED_DEPENDENCY

Source§

type Inner = T

Source§

type Pure = FailedDependency

Source§

impl<T> WrapsResponse for Forbidden<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::FORBIDDEN

Source§

type Inner = T

Source§

type Pure = Forbidden

Source§

impl<T> WrapsResponse for GatewayTimeout<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::GATEWAY_TIMEOUT

Source§

type Inner = T

Source§

type Pure = GatewayTimeout

Source§

impl<T> WrapsResponse for Gone<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::GONE

Source§

type Inner = T

Source§

type Pure = Gone

Source§

impl<T> WrapsResponse for HttpVersionNotSupported<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::HTTP_VERSION_NOT_SUPPORTED

Source§

type Inner = T

Source§

type Pure = HttpVersionNotSupported

Source§

impl<T> WrapsResponse for ImATeapot<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::IM_A_TEAPOT

Source§

type Inner = T

Source§

type Pure = ImATeapot

Source§

impl<T> WrapsResponse for InsufficientStorage<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::INSUFFICIENT_STORAGE

Source§

type Inner = T

Source§

type Pure = InsufficientStorage

Source§

impl<T> WrapsResponse for InternalServerError<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::INTERNAL_SERVER_ERROR

Source§

type Inner = T

Source§

type Pure = InternalServerError

Source§

impl<T> WrapsResponse for LengthRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::LENGTH_REQUIRED

Source§

type Inner = T

Source§

type Pure = LengthRequired

Source§

impl<T> WrapsResponse for Locked<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::LOCKED

Source§

type Inner = T

Source§

type Pure = Locked

Source§

impl<T> WrapsResponse for LoopDetected<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::LOOP_DETECTED

Source§

type Inner = T

Source§

type Pure = LoopDetected

Source§

impl<T> WrapsResponse for MethodNotAllowed<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::METHOD_NOT_ALLOWED

Source§

type Inner = T

Source§

type Pure = MethodNotAllowed

Source§

impl<T> WrapsResponse for MisdirectedRequest<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::MISDIRECTED_REQUEST

Source§

type Inner = T

Source§

type Pure = MisdirectedRequest

Source§

impl<T> WrapsResponse for NetworkAuthenticationRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NETWORK_AUTHENTICATION_REQUIRED

Source§

type Inner = T

Source§

type Pure = NetworkAuthenticationRequired

Source§

impl<T> WrapsResponse for NotAcceptable<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NOT_ACCEPTABLE

Source§

type Inner = T

Source§

type Pure = NotAcceptable

Source§

impl<T> WrapsResponse for NotExtended<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NOT_EXTENDED

Source§

type Inner = T

Source§

type Pure = NotExtended

Source§

impl<T> WrapsResponse for NotFound<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NOT_FOUND

Source§

type Inner = T

Source§

type Pure = NotFound

Source§

impl<T> WrapsResponse for NotImplemented<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::NOT_IMPLEMENTED

Source§

type Inner = T

Source§

type Pure = NotImplemented

Source§

impl<T> WrapsResponse for PaymentRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::PAYMENT_REQUIRED

Source§

type Inner = T

Source§

type Pure = PaymentRequired

Source§

impl<T> WrapsResponse for PreconditionFailed<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::PRECONDITION_FAILED

Source§

type Inner = T

Source§

type Pure = PreconditionFailed

Source§

impl<T> WrapsResponse for PreconditionRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::PRECONDITION_REQUIRED

Source§

type Inner = T

Source§

type Pure = PreconditionRequired

Source§

impl<T> WrapsResponse for ProxyAuthenticationRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::PROXY_AUTHENTICATION_REQUIRED

Source§

type Inner = T

Source§

type Pure = ProxyAuthenticationRequired

Source§

impl<T> WrapsResponse for RangeNotSatisfiable<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::RANGE_NOT_SATISFIABLE

Source§

type Inner = T

Source§

type Pure = RangeNotSatisfiable

Source§

impl<T> WrapsResponse 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> WrapsResponse for RequestTimeout<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::REQUEST_TIMEOUT

Source§

type Inner = T

Source§

type Pure = RequestTimeout

Source§

impl<T> WrapsResponse for ServiceUnavailable<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::SERVICE_UNAVAILABLE

Source§

type Inner = T

Source§

type Pure = ServiceUnavailable

Source§

impl<T> WrapsResponse for TooManyRequests<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::TOO_MANY_REQUESTS

Source§

type Inner = T

Source§

type Pure = TooManyRequests

Source§

impl<T> WrapsResponse for Unauthorized<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UNAUTHORIZED

Source§

type Inner = T

Source§

type Pure = Unauthorized

Source§

impl<T> WrapsResponse for UnavailableForLegalReasons<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UNAVAILABLE_FOR_LEGAL_REASONS

Source§

type Inner = T

Source§

type Pure = UnavailableForLegalReasons

Source§

impl<T> WrapsResponse for UnprocessableEntity<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UNPROCESSABLE_ENTITY

Source§

type Inner = T

Source§

type Pure = UnprocessableEntity

Source§

impl<T> WrapsResponse for UnsupportedMediaType<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UNSUPPORTED_MEDIA_TYPE

Source§

type Inner = T

Source§

type Pure = UnsupportedMediaType

Source§

impl<T> WrapsResponse for UpgradeRequired<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::UPGRADE_REQUIRED

Source§

type Inner = T

Source§

type Pure = UpgradeRequired

Source§

impl<T> WrapsResponse for UriTooLong<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::URI_TOO_LONG

Source§

type Inner = T

Source§

type Pure = UriTooLong

Source§

impl<T> WrapsResponse for VariantAlsoNegotiates<T>

Source§

const STATUS_CODE: StatusCode = StatusCode::VARIANT_ALSO_NEGOTIATES

Source§

type Inner = T

Source§

type Pure = VariantAlsoNegotiates