Struct poem_openapi::OpenApiService
source · [−]pub struct OpenApiService<T, W: ?Sized> { /* private fields */ }
Expand description
An OpenAPI service for Poem.
Implementations
Sets the webhooks.
Sets the summary of the API container.
Sets the description of the API container.
Sets a URL to the Terms of Service for the API.
Appends a server to the API container.
Reference: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverObject
Sets the license information for the exposed API.
Reference: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#license-object
Add a external document object.
Sets the cookie key.
Create the Swagger UI endpoint.
Create the Rapidoc endpoint.
Create an endpoint to serve the open api specification.
Trait Implementations
type Endpoint = BoxEndpoint<'static, Response>
type Endpoint = BoxEndpoint<'static, Response>
Represents the endpoint type.
Converts this object into endpoint.
Auto Trait Implementations
impl<T, W: ?Sized> RefUnwindSafe for OpenApiService<T, W> where
T: RefUnwindSafe,
W: RefUnwindSafe,
impl<T, W: ?Sized> Send for OpenApiService<T, W> where
T: Send,
W: Send,
impl<T, W: ?Sized> Sync for OpenApiService<T, W> where
T: Sync,
W: Sync,
impl<T, W: ?Sized> Unpin for OpenApiService<T, W> where
T: Unpin,
W: Unpin,
impl<T, W: ?Sized> UnwindSafe for OpenApiService<T, W> where
T: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the endpoint in a Box.
fn with<T>(self, middleware: T) -> <T as Middleware<Self::Endpoint>>::Output where
T: Middleware<Self::Endpoint>,
fn with<T>(self, middleware: T) -> <T as Middleware<Self::Endpoint>>::Output where
T: Middleware<Self::Endpoint>,
Use middleware to transform this endpoint. Read more
fn with_if<T>(
self,
enable: bool,
middleware: T
) -> EitherEndpoint<Self, <T as Middleware<Self::Endpoint>>::Output> where
T: Middleware<Self::Endpoint>,
fn with_if<T>(
self,
enable: bool,
middleware: T
) -> EitherEndpoint<Self, <T as Middleware<Self::Endpoint>>::Output> where
T: Middleware<Self::Endpoint>,
if enable
is true
then use middleware to transform this endpoint. Read more
A helper function, similar to with(AddData(T))
. Read more
Maps the request of this endpoint. Read more
Maps the output of this endpoint. Read more
Maps the request and response of this endpoint. Read more
Maps the response of this endpoint. Read more
Calls f
if the result is Ok
, otherwise returns the Err
value of
self. Read more
fn catch_all_error<F, Fut, R>(self, f: F) -> CatchAllError<Self, F, R> where
F: Fn(Error) -> Fut + Send + Sync,
Fut: Future<Output = R> + Send,
R: IntoResponse + Send,
Self: Sync,
fn catch_all_error<F, Fut, R>(self, f: F) -> CatchAllError<Self, F, R> where
F: Fn(Error) -> Fut + Send + Sync,
Fut: Future<Output = R> + Send,
R: IntoResponse + Send,
Self: Sync,
Catch the all errors and convert it into a response. Read more
fn catch_error<F, Fut, R, ErrType>(
self,
f: F
) -> CatchError<Self, F, R, ErrType> where
F: Fn(ErrType) -> Fut + Send + Sync,
Fut: Future<Output = R> + Send,
R: IntoResponse + Send + Sync,
ErrType: 'static + Error + Send + Sync,
fn catch_error<F, Fut, R, ErrType>(
self,
f: F
) -> CatchError<Self, F, R, ErrType> where
F: Fn(ErrType) -> Fut + Send + Sync,
Fut: Future<Output = R> + Send,
R: IntoResponse + Send + Sync,
ErrType: 'static + Error + Send + Sync,
Catch the specified type of error and convert it into a response. Read more
fn inspect_all_err<F>(self, f: F) -> InspectAllError<Self, F> where
F: Fn(&Error) + Send + Sync,
fn inspect_all_err<F>(self, f: F) -> InspectAllError<Self, F> where
F: Fn(&Error) + Send + Sync,
Does something with each error. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more