pub struct RouterBuilder { /* private fields */ }Expand description
A builder for constructing the router.
Implementations§
Source§impl RouterBuilder
impl RouterBuilder
Sourcepub fn add_route(self, path: &str, controller: Arc<dyn Controller>) -> Self
pub fn add_route(self, path: &str, controller: Arc<dyn Controller>) -> Self
Adds a route, creating the necessary nodes in the tree.
A trailing * segment is optional sugar for mounting the
controller at the prefix before it: "foo/*" routes identically to
"foo", and "*" identically to "" (the root) — a mounted
controller already receives the entire unconsumed path as its action,
so a “catch-all” is just a mount. The * is there so a reader of
app_routes! can see “this controller is the catch-all here” at a
glance. A * anywhere but the last segment is meaningless; such a
route is dropped with a warning.
Trait Implementations§
Source§impl Default for RouterBuilder
impl Default for RouterBuilder
Source§fn default() -> RouterBuilder
fn default() -> RouterBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RouterBuilder
impl !UnwindSafe for RouterBuilder
impl Freeze for RouterBuilder
impl Send for RouterBuilder
impl Sync for RouterBuilder
impl Unpin for RouterBuilder
impl UnsafeUnpin for RouterBuilder
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