Struct poem_openapi::OpenApiService
source · pub struct OpenApiService<T, W> { /* private fields */ }
Expand description
An OpenAPI service for Poem.
Implementations§
source§impl<T> OpenApiService<T, ()>
impl<T> OpenApiService<T, ()>
source§impl<T, W> OpenApiService<T, W>
impl<T, W> OpenApiService<T, W>
sourcepub fn webhooks<W2>(self) -> OpenApiService<T, W2>
pub fn webhooks<W2>(self) -> OpenApiService<T, W2>
Sets the webhooks.
sourcepub fn summary(self, summary: impl Into<String>) -> Self
pub fn summary(self, summary: impl Into<String>) -> Self
Sets the summary of the API container.
sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Sets the description of the API container.
sourcepub fn terms_of_service(self, url: impl Into<String>) -> Self
pub fn terms_of_service(self, url: impl Into<String>) -> Self
Sets a URL to the Terms of Service for the API.
sourcepub fn server(self, server: impl Into<ServerObject>) -> Self
pub fn server(self, server: impl Into<ServerObject>) -> Self
Appends a server to the API container.
Reference: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverObject
sourcepub fn contact(self, contact: ContactObject) -> Self
pub fn contact(self, contact: ContactObject) -> Self
Sets the contact information for the exposed API.
sourcepub fn license(self, license: impl Into<LicenseObject>) -> Self
pub fn license(self, license: impl Into<LicenseObject>) -> Self
Sets the license information for the exposed API.
Reference: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#license-object
sourcepub fn external_document(
self,
external_document: impl Into<ExternalDocumentObject>
) -> Self
pub fn external_document(
self,
external_document: impl Into<ExternalDocumentObject>
) -> Self
Add a external document object.
sourcepub fn extra_response_header<HT, H>(self, header: H) -> Selfwhere
HT: Type,
H: Into<ExtraHeader>,
pub fn extra_response_header<HT, H>(self, header: H) -> Selfwhere
HT: Type,
H: Into<ExtraHeader>,
Add extra response header
sourcepub fn extra_request_header<HT, H>(self, header: H) -> Selfwhere
HT: Type,
H: Into<ExtraHeader>,
pub fn extra_request_header<HT, H>(self, header: H) -> Selfwhere
HT: Type,
H: Into<ExtraHeader>,
Add extra request header
Sets the cookie key.
sourcepub fn url_prefix(self, url_prefix: impl Into<String>) -> Self
pub fn url_prefix(self, url_prefix: impl Into<String>) -> Self
Sets optional URl prefix to be added to path
sourcepub fn openapi_explorer(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
pub fn openapi_explorer(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
Create the OpenAPI Explorer endpoint.
sourcepub fn openapi_explorer_html(&self) -> Stringwhere
T: OpenApi,
W: Webhook,
pub fn openapi_explorer_html(&self) -> Stringwhere
T: OpenApi,
W: Webhook,
Create the OpenAPI Explorer HTML
sourcepub fn swagger_ui(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
pub fn swagger_ui(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
Create the Swagger UI endpoint.
sourcepub fn swagger_ui_html(&self) -> Stringwhere
T: OpenApi,
W: Webhook,
pub fn swagger_ui_html(&self) -> Stringwhere
T: OpenApi,
W: Webhook,
Create the Swagger UI HTML
sourcepub fn rapidoc(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
pub fn rapidoc(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
Create the Rapidoc endpoint.
sourcepub fn rapidoc_html(&self) -> Stringwhere
T: OpenApi,
W: Webhook,
pub fn rapidoc_html(&self) -> Stringwhere
T: OpenApi,
W: Webhook,
Create the Rapidoc HTML
sourcepub fn redoc_html(&self) -> Stringwhere
T: OpenApi,
W: Webhook,
pub fn redoc_html(&self) -> Stringwhere
T: OpenApi,
W: Webhook,
Create the Redoc HTML
sourcepub fn spec_endpoint(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
pub fn spec_endpoint(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
Create an endpoint to serve the open api specification as JSON.
sourcepub fn spec_endpoint_yaml(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
pub fn spec_endpoint_yaml(&self) -> impl Endpointwhere
T: OpenApi,
W: Webhook,
Create an endpoint to serve the open api specification as YAML.
Trait Implementations§
Auto Trait Implementations§
impl<T, W> RefUnwindSafe for OpenApiService<T, W>where
T: RefUnwindSafe,
W: RefUnwindSafe,
impl<T, W> Send for OpenApiService<T, W>where
T: Send,
W: Send,
impl<T, W> Sync for OpenApiService<T, W>where
T: Sync,
W: Sync,
impl<T, W> Unpin for OpenApiService<T, W>where
T: Unpin,
W: Unpin,
impl<T, W> UnwindSafe for OpenApiService<T, W>where
T: UnwindSafe,
W: UnwindSafe,
Blanket Implementations§
source§impl<T> EndpointExt for Twhere
T: IntoEndpoint,
impl<T> EndpointExt for Twhere
T: IntoEndpoint,
source§fn boxed<'a>(
self
) -> Box<dyn Endpoint<Output = <Self::Endpoint as Endpoint>::Output> + 'a, Global>where
Self: Sized + 'a,
fn boxed<'a>(
self
) -> Box<dyn Endpoint<Output = <Self::Endpoint as Endpoint>::Output> + 'a, Global>where
Self: Sized + 'a,
source§fn with<T>(self, middleware: T) -> <T as Middleware<Self::Endpoint>>::Outputwhere
T: Middleware<Self::Endpoint>,
Self: Sized,
fn with<T>(self, middleware: T) -> <T as Middleware<Self::Endpoint>>::Outputwhere
T: Middleware<Self::Endpoint>,
Self: Sized,
source§fn with_if<T>(
self,
enable: bool,
middleware: T
) -> EitherEndpoint<Self, <T as Middleware<Self::Endpoint>>::Output>where
T: Middleware<Self::Endpoint>,
Self: Sized,
fn with_if<T>(
self,
enable: bool,
middleware: T
) -> EitherEndpoint<Self, <T as Middleware<Self::Endpoint>>::Output>where
T: Middleware<Self::Endpoint>,
Self: Sized,
source§fn data<T>(self, data: T) -> AddDataEndpoint<Self::Endpoint, T>where
T: Clone + Send + Sync + 'static,
Self: Sized,
fn data<T>(self, data: T) -> AddDataEndpoint<Self::Endpoint, T>where
T: Clone + Send + Sync + 'static,
Self: Sized,
with(AddData(T))
. Read moresource§fn data_opt<T>(
self,
data: Option<T>
) -> EitherEndpoint<AddDataEndpoint<Self::Endpoint, T>, Self>where
T: Clone + Send + Sync + 'static,
Self: Sized,
fn data_opt<T>(
self,
data: Option<T>
) -> EitherEndpoint<AddDataEndpoint<Self::Endpoint, T>, Self>where
T: Clone + Send + Sync + 'static,
Self: Sized,
data
is Some(T)
then attach the value to the endpoint.