pub struct OpenApiConfig {
pub exposed: bool,
/* private fields */
}Expand description
OpenAPI runtime configuration.
Fields§
§exposed: boolReturns true if the OpenAPI have been exposed.
This is a runtime flag set by App::use_open_api and is not configurable from a file.
Implementations§
Source§impl OpenApiConfig
impl OpenApiConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new OpenApiConfig with defaults.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Sets the OpenAPI document title.
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Sets the OpenAPI document version.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the OpenAPI document description.
Sourcepub fn with_spec(self, spec: OpenApiSpec) -> Self
pub fn with_spec(self, spec: OpenApiSpec) -> Self
Sets the OpenAPI spec.
Default: /openapi.json
Sourcepub fn with_specs<I, S>(self, specs: I) -> Self
pub fn with_specs<I, S>(self, specs: I) -> Self
Sets the OpenAPI specs.
Default: /openapi.json
Sourcepub fn with_ui_path(self, path: impl Into<String>) -> Self
pub fn with_ui_path(self, path: impl Into<String>) -> Self
Sets the path where the OpenAPI UI is served.
Default: /openapi
Sourcepub fn specs(&self) -> &[OpenApiSpec]
pub fn specs(&self) -> &[OpenApiSpec]
Returns a list of registered OpenAPI specs.
Sourcepub fn ui_enabled(&self) -> bool
pub fn ui_enabled(&self) -> bool
Returns true if UI is enabled.
Trait Implementations§
Source§impl Clone for OpenApiConfig
impl Clone for OpenApiConfig
Source§fn clone(&self) -> OpenApiConfig
fn clone(&self) -> OpenApiConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenApiConfig
impl Debug for OpenApiConfig
Source§impl Default for OpenApiConfig
impl Default for OpenApiConfig
Source§impl<'de> Deserialize<'de> for OpenApiConfigwhere
OpenApiConfig: Default,
impl<'de> Deserialize<'de> for OpenApiConfigwhere
OpenApiConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OpenApiConfig
impl RefUnwindSafe for OpenApiConfig
impl Send for OpenApiConfig
impl Sync for OpenApiConfig
impl Unpin for OpenApiConfig
impl UnsafeUnpin for OpenApiConfig
impl UnwindSafe for OpenApiConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more