pub struct RouteDefinition { /* private fields */ }Expand description
A route declaration that can be mounted by a controller.
Implementations§
Source§impl RouteDefinition
impl RouteDefinition
Sourcepub fn try_get<H, T>(
path: impl Into<String>,
handler: H,
) -> Result<Self, RoutePathError>
pub fn try_get<H, T>( path: impl Into<String>, handler: H, ) -> Result<Self, RoutePathError>
Tries to create a GET route.
Sourcepub fn try_post<H, T>(
path: impl Into<String>,
handler: H,
) -> Result<Self, RoutePathError>
pub fn try_post<H, T>( path: impl Into<String>, handler: H, ) -> Result<Self, RoutePathError>
Tries to create a POST route.
Sourcepub fn try_put<H, T>(
path: impl Into<String>,
handler: H,
) -> Result<Self, RoutePathError>
pub fn try_put<H, T>( path: impl Into<String>, handler: H, ) -> Result<Self, RoutePathError>
Tries to create a PUT route.
Sourcepub fn try_patch<H, T>(
path: impl Into<String>,
handler: H,
) -> Result<Self, RoutePathError>
pub fn try_patch<H, T>( path: impl Into<String>, handler: H, ) -> Result<Self, RoutePathError>
Tries to create a PATCH route.
Sourcepub fn try_delete<H, T>(
path: impl Into<String>,
handler: H,
) -> Result<Self, RoutePathError>
pub fn try_delete<H, T>( path: impl Into<String>, handler: H, ) -> Result<Self, RoutePathError>
Tries to create a DELETE route.
Auto Trait Implementations§
impl !RefUnwindSafe for RouteDefinition
impl !UnwindSafe for RouteDefinition
impl Freeze for RouteDefinition
impl Send for RouteDefinition
impl Sync for RouteDefinition
impl Unpin for RouteDefinition
impl UnsafeUnpin for RouteDefinition
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