pub struct SwaggerUi { /* private fields */ }Available on crate features
openapi and swagger-ui only.Expand description
A wrapper around the Swagger UI functionality.
This struct serves the Swagger UI interface for OpenAPI documentation. It can be registered with a Cot application to provide interactive API documentation at a specified URL path.
§Example
use cot::openapi::swagger_ui::SwaggerUi;
use cot::project::{AppBuilder, RegisterAppsContext};
fn register_apps(apps: &mut AppBuilder, _context: &RegisterAppsContext) {
// Register SwaggerUI at the "/swagger" path
apps.register_with_views(SwaggerUi::new(), "/swagger");
}Implementations§
Trait Implementations§
Source§impl App for SwaggerUi
impl App for SwaggerUi
Source§fn router(&self) -> Router
fn router(&self) -> Router
Returns the router for the app. By default, it returns an empty router. Read more
Source§fn static_files(&self) -> Vec<StaticFile>
fn static_files(&self) -> Vec<StaticFile>
Returns a list of static files that the app serves. By default, it
returns an empty list.
Source§fn init<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 mut ProjectContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn init<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 mut ProjectContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Initializes the app. Read more
Source§fn migrations(&self) -> Vec<Box<SyncDynMigration>>
fn migrations(&self) -> Vec<Box<SyncDynMigration>>
Available on crate feature
db only.Returns the migrations for the app. By default, it returns an empty
list.
Source§fn admin_model_managers(&self) -> Vec<Box<dyn AdminModelManager>>
fn admin_model_managers(&self) -> Vec<Box<dyn AdminModelManager>>
Returns the admin model managers for the app. By default, it returns an
empty list.
Auto Trait Implementations§
impl Freeze for SwaggerUi
impl RefUnwindSafe for SwaggerUi
impl Send for SwaggerUi
impl Sync for SwaggerUi
impl Unpin for SwaggerUi
impl UnwindSafe for SwaggerUi
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoField<Auto<T>> for T
impl<T> IntoField<Auto<T>> for T
Source§fn into_field(self) -> Auto<T>
fn into_field(self) -> Auto<T>
Available on crate feature
db only.Converts the type to the field type.