pub struct RustApi { /* private fields */ }Expand description
Implementations§
Source§impl RustApi
impl RustApi
Sourcepub fn register_schema<T: for<'a> Schema<'a>>(self) -> Self
pub fn register_schema<T: for<'a> Schema<'a>>(self) -> Self
Sourcepub fn openapi_info(
self,
title: &str,
version: &str,
description: Option<&str>,
) -> Self
pub fn openapi_info( self, title: &str, version: &str, description: Option<&str>, ) -> Self
Configure OpenAPI info (title, version, description)
Sourcepub fn route(self, path: &str, method_router: MethodRouter) -> Self
pub fn route(self, path: &str, method_router: MethodRouter) -> Self
Sourcepub fn mount(self, path: &str, method_router: MethodRouter) -> Self
👎Deprecated: Use route() directly or mount_route() for macro-based routing
pub fn mount(self, path: &str, method_router: MethodRouter) -> Self
Mount a handler (convenience method)
Alias for .route(path, method_router) for a single handler.
Sourcepub fn mount_route(self, route: Route) -> Self
pub fn mount_route(self, route: Route) -> Self
Sourcepub fn docs_with_info(
self,
path: &str,
title: &str,
version: &str,
description: Option<&str>,
) -> Self
pub fn docs_with_info( self, path: &str, title: &str, version: &str, description: Option<&str>, ) -> Self
Sourcepub fn into_router(self) -> Router
pub fn into_router(self) -> Router
Get the inner router (for testing or advanced usage)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RustApi
impl !RefUnwindSafe for RustApi
impl Send for RustApi
impl Sync for RustApi
impl Unpin for RustApi
impl !UnwindSafe for RustApi
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