pub struct OpenApiBuilder { /* private fields */ }Expand description
Builder for constructing an OpenAPI spec from plugins and core routes.
Implementations§
Source§impl OpenApiBuilder
impl OpenApiBuilder
pub fn new(title: impl Into<String>, version: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Sourcepub fn route(
self,
method: &HttpMethod,
path: &str,
operation_id: &str,
tag: &str,
) -> Self
pub fn route( self, method: &HttpMethod, path: &str, operation_id: &str, tag: &str, ) -> Self
Add a single route entry.
Sourcepub fn plugin<DB: DatabaseAdapter>(self, plugin: &dyn AuthPlugin<DB>) -> Self
pub fn plugin<DB: DatabaseAdapter>(self, plugin: &dyn AuthPlugin<DB>) -> Self
Register all routes from a plugin.
Sourcepub fn core_routes(self) -> Self
pub fn core_routes(self) -> Self
Register core routes that are not part of any plugin.
Sourcepub fn build(self) -> OpenApiSpec
pub fn build(self) -> OpenApiSpec
Build the final OpenAPI spec.
Auto Trait Implementations§
impl Freeze for OpenApiBuilder
impl RefUnwindSafe for OpenApiBuilder
impl Send for OpenApiBuilder
impl Sync for OpenApiBuilder
impl Unpin for OpenApiBuilder
impl UnsafeUnpin for OpenApiBuilder
impl UnwindSafe for OpenApiBuilder
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