pub struct Controller { /* private fields */ }Expand description
Controller route group with a shared path prefix.
Implementations§
Source§impl Controller
impl Controller
Sourcepub fn try_new(prefix: impl Into<String>) -> Result<Self, RoutePathError>
pub fn try_new(prefix: impl Into<String>) -> Result<Self, RoutePathError>
Tries to create an empty controller route group with a validated prefix.
Sourcepub fn route(self, route: RouteDefinition) -> Self
pub fn route(self, route: RouteDefinition) -> Self
Adds a route to this controller.
Sourcepub fn into_router(self) -> Router
pub fn into_router(self) -> Router
Builds an Axum router from the controller routes.
Sourcepub fn try_into_router(self) -> Result<Router, RoutePathError>
pub fn try_into_router(self) -> Result<Router, RoutePathError>
Tries to build an Axum router from the controller routes.
Auto Trait Implementations§
impl !RefUnwindSafe for Controller
impl !UnwindSafe for Controller
impl Freeze for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnsafeUnpin for Controller
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