Skip to main content

ApiResponse

Struct ApiResponse 

Source
pub struct ApiResponse<S> { /* private fields */ }

Implementations§

Source§

impl<S> ApiResponse<S>

Source

pub fn new<T>(wrapper: T) -> Self
where S: Contains<T>, T: WrapsResponse<Inner: IntoResponse>,

Trait Implementations§

Source§

impl<T, S> From<BadGateway<T>> for ApiResponse<S>

Source§

fn from(err: BadGateway<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<BadRequest<T>> for ApiResponse<S>

Source§

fn from(err: BadRequest<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<Conflict<T>> for ApiResponse<S>

Source§

fn from(err: Conflict<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<ExpectationFailed<T>> for ApiResponse<S>

Source§

fn from(err: ExpectationFailed<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<FailedDependency<T>> for ApiResponse<S>

Source§

fn from(err: FailedDependency<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<Forbidden<T>> for ApiResponse<S>

Source§

fn from(err: Forbidden<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<GatewayTimeout<T>> for ApiResponse<S>

Source§

fn from(err: GatewayTimeout<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<Gone<T>> for ApiResponse<S>
where S: Contains<Gone<T>>, Gone<T>: WrapsResponse<Inner: IntoResponse>,

Source§

fn from(err: Gone<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<HttpVersionNotSupported<T>> for ApiResponse<S>

Source§

fn from(err: HttpVersionNotSupported<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<ImATeapot<T>> for ApiResponse<S>

Source§

fn from(err: ImATeapot<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<InsufficientStorage<T>> for ApiResponse<S>

Source§

fn from(err: InsufficientStorage<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<InternalServerError<T>> for ApiResponse<S>

Source§

fn from(err: InternalServerError<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<LengthRequired<T>> for ApiResponse<S>

Source§

fn from(err: LengthRequired<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<Locked<T>> for ApiResponse<S>
where S: Contains<Locked<T>>, Locked<T>: WrapsResponse<Inner: IntoResponse>,

Source§

fn from(err: Locked<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<LoopDetected<T>> for ApiResponse<S>

Source§

fn from(err: LoopDetected<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<MethodNotAllowed<T>> for ApiResponse<S>

Source§

fn from(err: MethodNotAllowed<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<MisdirectedRequest<T>> for ApiResponse<S>

Source§

fn from(err: MisdirectedRequest<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<NetworkAuthenticationRequired<T>> for ApiResponse<S>

Source§

fn from(err: NetworkAuthenticationRequired<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<NotAcceptable<T>> for ApiResponse<S>

Source§

fn from(err: NotAcceptable<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<NotExtended<T>> for ApiResponse<S>

Source§

fn from(err: NotExtended<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<NotFound<T>> for ApiResponse<S>

Source§

fn from(err: NotFound<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<NotImplemented<T>> for ApiResponse<S>

Source§

fn from(err: NotImplemented<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<PaymentRequired<T>> for ApiResponse<S>

Source§

fn from(err: PaymentRequired<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<PreconditionFailed<T>> for ApiResponse<S>

Source§

fn from(err: PreconditionFailed<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<PreconditionRequired<T>> for ApiResponse<S>

Source§

fn from(err: PreconditionRequired<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<ProxyAuthenticationRequired<T>> for ApiResponse<S>

Source§

fn from(err: ProxyAuthenticationRequired<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<RangeNotSatisfiable<T>> for ApiResponse<S>

Source§

fn from(err: RangeNotSatisfiable<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<RequestHeaderFieldsTooLarge<T>> for ApiResponse<S>

Source§

fn from(err: RequestHeaderFieldsTooLarge<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<RequestTimeout<T>> for ApiResponse<S>

Source§

fn from(err: RequestTimeout<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<ServiceUnavailable<T>> for ApiResponse<S>

Source§

fn from(err: ServiceUnavailable<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<TooManyRequests<T>> for ApiResponse<S>

Source§

fn from(err: TooManyRequests<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<Unauthorized<T>> for ApiResponse<S>

Source§

fn from(err: Unauthorized<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<UnavailableForLegalReasons<T>> for ApiResponse<S>

Source§

fn from(err: UnavailableForLegalReasons<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<UnprocessableEntity<T>> for ApiResponse<S>

Source§

fn from(err: UnprocessableEntity<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<UnsupportedMediaType<T>> for ApiResponse<S>

Source§

fn from(err: UnsupportedMediaType<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<UpgradeRequired<T>> for ApiResponse<S>

Source§

fn from(err: UpgradeRequired<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<UriTooLong<T>> for ApiResponse<S>

Source§

fn from(err: UriTooLong<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, S> From<VariantAlsoNegotiates<T>> for ApiResponse<S>

Source§

fn from(err: VariantAlsoNegotiates<T>) -> Self

Converts to this type from the input type.
Source§

impl<S> IntoResponse for ApiResponse<S>

Source§

fn into_response(self) -> Response

Create a response.
Source§

impl OperationOutput for ApiResponse<()>

Available on crate feature aide only.
Source§

type Inner = (StatusCode, Response<Body>)

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<E1> OperationOutput for ApiResponse<(E1,)>
where E1: WrapsResponse<Inner: OperationOutput>,

Available on crate feature aide only.
Source§

type Inner = (StatusCode, Response<Body>)

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<E1, E2> OperationOutput for ApiResponse<(E1, E2)>

Available on crate feature aide only.
Source§

type Inner = (StatusCode, Response<Body>)

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<E1, E2, E3> OperationOutput for ApiResponse<(E1, E2, E3)>

Available on crate feature aide only.
Source§

type Inner = (StatusCode, Response<Body>)

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<E1, E2, E3, E4> OperationOutput for ApiResponse<(E1, E2, E3, E4)>

Available on crate feature aide only.
Source§

type Inner = (StatusCode, Response<Body>)

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<E1, E2, E3, E4, E5> OperationOutput for ApiResponse<(E1, E2, E3, E4, E5)>

Available on crate feature aide only.
Source§

type Inner = (StatusCode, Response<Body>)

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<E1, E2, E3, E4, E5, E6> OperationOutput for ApiResponse<(E1, E2, E3, E4, E5, E6)>

Available on crate feature aide only.
Source§

type Inner = (StatusCode, Response<Body>)

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<E1, E2, E3, E4, E5, E6, E7> OperationOutput for ApiResponse<(E1, E2, E3, E4, E5, E6, E7)>

Available on crate feature aide only.
Source§

type Inner = (StatusCode, Response<Body>)

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<E1, E2, E3, E4, E5, E6, E7, E8> OperationOutput for ApiResponse<(E1, E2, E3, E4, E5, E6, E7, E8)>

Available on crate feature aide only.
Source§

type Inner = (StatusCode, Response<Body>)

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more

Auto Trait Implementations§

§

impl<S> !RefUnwindSafe for ApiResponse<S>

§

impl<S> !Sync for ApiResponse<S>

§

impl<S> !UnwindSafe for ApiResponse<S>

§

impl<S> Freeze for ApiResponse<S>
where PhantomData<fn() -> S>: Freeze,

§

impl<S> Send for ApiResponse<S>
where PhantomData<fn() -> S>: Send,

§

impl<S> Unpin for ApiResponse<S>
where PhantomData<fn() -> S>: Unpin,

§

impl<S> UnsafeUnpin for ApiResponse<S>
where PhantomData<fn() -> S>: UnsafeUnpin,

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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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> IntoApi for T

Source§

fn into_api<A>(self) -> UseApi<T, A>
where T: Sized,

into UseApi
Source§

impl<S1, S2> SupersetOf<S2> for S1
where S2: SubsetOf<S1> + ?Sized, S1: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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