pub struct RouteSegment<State> { /* private fields */ }
Expand description
A Builder for Tide routes. RouteBuilders can be composed into a tree that represents the tree of path segments, middleware and endpoints that defines the routes in a Tide application. This tree can then be returned as a list of routes to each of the endpoints.
Implementations§
Source§impl<State: Clone + Send + Sync + 'static> RouteSegment<State>
impl<State: Clone + Send + Sync + 'static> RouteSegment<State>
Sourcepub fn reverse_router(&self) -> ReverseRouter
pub fn reverse_router(&self) -> ReverseRouter
Construct a reverse router for the paths in the route builder
Trait Implementations§
Source§impl<State: Debug> Debug for RouteSegment<State>
impl<State: Debug> Debug for RouteSegment<State>
Source§impl<State: Clone + Send + Sync + 'static> RouteBuilder<State> for RouteSegment<State>
impl<State: Clone + Send + Sync + 'static> RouteBuilder<State> for RouteSegment<State>
Source§fn at<R: FnOnce(Self) -> Self>(self, path: &str, routes: R) -> Self
fn at<R: FnOnce(Self) -> Self>(self, path: &str, routes: R) -> Self
Add a path segment with a set of sub-routes
Source§fn with<M: Middleware<State>, R: FnOnce(Self) -> Self>(
self,
middleware: M,
routes: R,
) -> Self
fn with<M: Middleware<State>, R: FnOnce(Self) -> Self>( self, middleware: M, routes: R, ) -> Self
Add middleware with a set of sub-routes
Auto Trait Implementations§
impl<State> Freeze for RouteSegment<State>
impl<State> !RefUnwindSafe for RouteSegment<State>
impl<State> Send for RouteSegment<State>
impl<State> Sync for RouteSegment<State>
impl<State> Unpin for RouteSegment<State>
impl<State> !UnwindSafe for RouteSegment<State>
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