pub struct RouteGroup {
pub prefix: String,
pub middleware: Vec<String>,
pub routes: Vec<RouteDefinition>,
pub name: Option<String>,
pub description: Option<String>,
}
Expand description
Route group for organizing related routes
Fields§
§prefix: String
§middleware: Vec<String>
§routes: Vec<RouteDefinition>
§name: Option<String>
§description: Option<String>
Implementations§
Source§impl RouteGroup
impl RouteGroup
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set group description
Sourcepub fn with_middleware(self, middleware: Vec<String>) -> Self
pub fn with_middleware(self, middleware: Vec<String>) -> Self
Add middleware to the group
Sourcepub fn with_routes(self, routes: Vec<RouteDefinition>) -> Self
pub fn with_routes(self, routes: Vec<RouteDefinition>) -> Self
Add routes to the group
Sourcepub fn add_route(self, route: RouteDefinition) -> Self
pub fn add_route(self, route: RouteDefinition) -> Self
Add a single route
Sourcepub fn prefixed_routes(&self) -> Vec<RouteDefinition>
pub fn prefixed_routes(&self) -> Vec<RouteDefinition>
Get all routes with prefix applied
Trait Implementations§
Source§impl Clone for RouteGroup
impl Clone for RouteGroup
Source§fn clone(&self) -> RouteGroup
fn clone(&self) -> RouteGroup
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto 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