Trait gotham_restful::ResponseSchema
source · [−]pub trait ResponseSchema {
fn schema(code: StatusCode) -> OpenapiSchema;
fn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
{ ... }
}
Expand description
Additional details for IntoResponse to be used with an OpenAPI-aware router.
Required methods
fn schema(code: StatusCode) -> OpenapiSchema
fn schema(code: StatusCode) -> OpenapiSchema
Return the schema of the response for the given status code. The code may only be one that was previously returned by Self::status_codes. The implementation should panic if that is not the case.
Provided methods
fn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
All status codes returned by this response. Returns [StatusCode::OK]
by default.
Implementations on Foreign Types
sourceimpl<E> ResponseSchema for Result<NoContent, E> where
E: Debug + IntoResponseError<Err = Error>,
impl<E> ResponseSchema for Result<NoContent, E> where
E: Debug + IntoResponseError<Err = Error>,
fn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn schema(code: StatusCode) -> OpenapiSchema
sourceimpl<T, E> ResponseSchema for Result<Raw<T>, E> where
Raw<T>: IntoResponseWithSchema,
E: Debug + IntoResponseError<Err = <Raw<T> as IntoResponse>::Err>,
impl<T, E> ResponseSchema for Result<Raw<T>, E> where
Raw<T>: IntoResponseWithSchema,
E: Debug + IntoResponseError<Err = <Raw<T> as IntoResponse>::Err>,
fn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn schema(code: StatusCode) -> OpenapiSchema
sourceimpl<E> ResponseSchema for Result<Redirect, E> where
E: Debug + IntoResponseError,
<E as IntoResponseError>::Err: StdError + Sync,
impl<E> ResponseSchema for Result<Redirect, E> where
E: Debug + IntoResponseError,
<E as IntoResponseError>::Err: StdError + Sync,
fn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn schema(code: StatusCode) -> OpenapiSchema
sourceimpl<R, E> ResponseSchema for Result<R, E> where
R: ResponseBody,
E: Debug + IntoResponseError<Err = Error>,
impl<R, E> ResponseSchema for Result<R, E> where
R: ResponseBody,
E: Debug + IntoResponseError<Err = Error>,
fn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn schema(code: StatusCode) -> OpenapiSchema
sourceimpl<Res> ResponseSchema for Pin<Box<dyn Future<Output = Res> + Send>> where
Res: ResponseSchema,
impl<Res> ResponseSchema for Pin<Box<dyn Future<Output = Res> + Send>> where
Res: ResponseSchema,
fn status_codes() -> Vec<StatusCode>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,