pub struct RouteGroup {
pub prefix: String,
pub middleware: Vec<String>,
pub routes: Vec<Route>,
}
Expand description
Route group for organizing related routes
Fields§
§prefix: String
Group prefix
middleware: Vec<String>
Group middleware
routes: Vec<Route>
Routes in this group
Implementations§
Source§impl RouteGroup
impl RouteGroup
Sourcepub fn get<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
pub fn get<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
Adds a GET route to the group
Sourcepub fn get_with_id<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
pub fn get_with_id<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
Adds a GET route with ID parameter to the group
Sourcepub fn post<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
pub fn post<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
Adds a POST route to the group
Sourcepub fn put<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
pub fn put<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
Adds a PUT route to the group
Sourcepub fn delete<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
pub fn delete<F, Fut>(&mut self, path: &str, handler: F) -> &mut Self
Adds a DELETE route to the group
Sourcepub fn middleware(&mut self, middleware: Vec<String>) -> &mut Self
pub fn middleware(&mut self, middleware: Vec<String>) -> &mut Self
Adds middleware to the group
Auto Trait Implementations§
impl Freeze for RouteGroup
impl !RefUnwindSafe for RouteGroup
impl Send for RouteGroup
impl Sync for RouteGroup
impl Unpin for RouteGroup
impl !UnwindSafe for RouteGroup
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