Struct poem_openapi::OpenApiService [−][src]
pub struct OpenApiService<T> { /* fields omitted */ }Expand description
An OpenAPI service for Poem.
Implementations
Create an OpenAPI container.
Sets the description of the API container.
Appends a server to the API container.
Reference: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverObject
Appends a server and description to the API container.
Sets the cookie key.
Create the Swagger UI 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> RefUnwindSafe for OpenApiService<T> where
T: RefUnwindSafe,
impl<T> Send for OpenApiService<T> where
T: Send,
impl<T> Sync for OpenApiService<T> where
T: Sync,
impl<T> Unpin for OpenApiService<T> where
T: Unpin,
impl<T> UnwindSafe for OpenApiService<T> where
T: 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
fn and_then<F, Fut, Err, R, R2>(self, f: F) -> AndThen<Self::Endpoint, F> where
F: Fn(R) -> Fut + Send + Sync,
Fut: Future<Output = Result<R2, Err>> + Send,
Err: IntoResponse,
R: IntoResponse,
R2: IntoResponse,
Self::Endpoint: Endpoint,
Self::Endpoint: Sized,
<Self::Endpoint as Endpoint>::Output == Result<R, Err>,
fn and_then<F, Fut, Err, R, R2>(self, f: F) -> AndThen<Self::Endpoint, F> where
F: Fn(R) -> Fut + Send + Sync,
Fut: Future<Output = Result<R2, Err>> + Send,
Err: IntoResponse,
R: IntoResponse,
R2: IntoResponse,
Self::Endpoint: Endpoint,
Self::Endpoint: Sized,
<Self::Endpoint as Endpoint>::Output == Result<R, Err>,
Calls f if the result is Ok, otherwise returns the Err value of
self. Read more
Maps the response of this endpoint. Read more
fn map_err<F, Fut, InErr, OutErr, R>(self, f: F) -> MapErr<Self::Endpoint, F> where
F: Fn(InErr) -> Fut + Send + Sync,
Fut: Future<Output = OutErr> + Send,
InErr: IntoResponse,
OutErr: IntoResponse,
R: IntoResponse,
Self::Endpoint: Endpoint,
Self::Endpoint: Sized,
<Self::Endpoint as Endpoint>::Output == Result<R, InErr>,
fn map_err<F, Fut, InErr, OutErr, R>(self, f: F) -> MapErr<Self::Endpoint, F> where
F: Fn(InErr) -> Fut + Send + Sync,
Fut: Future<Output = OutErr> + Send,
InErr: IntoResponse,
OutErr: IntoResponse,
R: IntoResponse,
Self::Endpoint: Endpoint,
Self::Endpoint: Sized,
<Self::Endpoint as Endpoint>::Output == Result<R, InErr>,
Maps the error of this endpoint. 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