pub struct ScopeBuilder<'a, C, P> where
C: PipelineHandleChain<P> + Copy + Send + Sync + 'static,
P: Send + Sync + 'static, { /* private fields */ }
Expand description
A scoped builder, which is created by DrawRoutes::scope
and passed to the provided closure.
The DrawRoutes
trait has documentation for using this type.
Trait Implementations
sourceimpl<'a, C, P> DrawRoutes<C, P> for ScopeBuilder<'a, C, P> where
C: PipelineHandleChain<P> + Copy + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
impl<'a, C, P> DrawRoutes<C, P> for ScopeBuilder<'a, C, P> where
C: PipelineHandleChain<P> + Copy + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
sourcefn get_or_head<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
fn get_or_head<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
Creates a route which matches GET
and HEAD
requests to the given path. Read more
sourcefn get<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
fn get<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
Creates a route which matches only GET
requests to the given path (ignoring HEAD
requests). Read more
sourcefn head<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
fn head<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
Creates a route which matches HEAD
requests to the given path. Read more
sourcefn post<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
fn post<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
Creates a route which matches POST
requests to the given path. Read more
sourcefn put<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
fn put<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
Creates a route which matches PUT
requests to the given path. Read more
sourcefn patch<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
fn patch<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
Creates a route which matches PATCH
requests to the given path. Read more
sourcefn delete<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
fn delete<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
Creates a route which matches DELETE
requests to the given path. Read more
sourcefn options<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
fn options<'b>(
&'b mut self,
path: &str
) -> SingleRouteBuilder<'b, MethodOnlyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>
Creates a route which matches OPTIONS
requests to the given path. Read more
sourcefn request<'b, IRM, M>(
&'b mut self,
matcher: IRM,
path: &str
) -> SingleRouteBuilder<'b, M, C, P, NoopPathExtractor, NoopQueryStringExtractor> where
IRM: IntoRouteMatcher<Output = M>,
M: RouteMatcher + Send + Sync + 'static,
fn request<'b, IRM, M>(
&'b mut self,
matcher: IRM,
path: &str
) -> SingleRouteBuilder<'b, M, C, P, NoopPathExtractor, NoopQueryStringExtractor> where
IRM: IntoRouteMatcher<Output = M>,
M: RouteMatcher + Send + Sync + 'static,
Creates a single route which matches any requests to the given path
with one of the
given methods
. The path
can consist of static or dynamic segments, for example: Read more
sourcefn scope<F>(&mut self, path: &str, f: F) where
F: FnOnce(&mut ScopeBuilder<'_, C, P>),
fn scope<F>(&mut self, path: &str, f: F) where
F: FnOnce(&mut ScopeBuilder<'_, C, P>),
Begins defining a new scope, based on a given path
prefix. Read more
sourcefn with_pipeline_chain<F, NC>(&mut self, pipeline_chain: NC, f: F) where
F: FnOnce(&mut ScopeBuilder<'_, NC, P>),
NC: PipelineHandleChain<P> + Copy + Send + Sync + 'static,
fn with_pipeline_chain<F, NC>(&mut self, pipeline_chain: NC, f: F) where
F: FnOnce(&mut ScopeBuilder<'_, NC, P>),
NC: PipelineHandleChain<P> + Copy + Send + Sync + 'static,
Begins a new scope at the current location, with an alternate pipeline chain. Read more
sourcefn delegate<'b>(
&'b mut self,
path: &str
) -> DelegateRouteBuilder<'b, AnyRouteMatcher, C, P>
fn delegate<'b>(
&'b mut self,
path: &str
) -> DelegateRouteBuilder<'b, AnyRouteMatcher, C, P>
Begins delegating a subpath of the tree. Read more
sourcefn delegate_without_pipelines<'b>(
&'b mut self,
path: &str
) -> DelegateRouteBuilder<'b, AnyRouteMatcher, (), P>
fn delegate_without_pipelines<'b>(
&'b mut self,
path: &str
) -> DelegateRouteBuilder<'b, AnyRouteMatcher, (), P>
Begins delegating a subpath of the tree, but does not dispatch the requests via this
router’s PipelineChain
. Read more
sourcefn associate<'b, F>(&'b mut self, path: &str, f: F) where
F: FnOnce(&mut AssociatedRouteBuilder<'b, AnyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>),
fn associate<'b, F>(&'b mut self, path: &str, f: F) where
F: FnOnce(&mut AssociatedRouteBuilder<'b, AnyRouteMatcher, C, P, NoopPathExtractor, NoopQueryStringExtractor>),
Begins associating routes with a fixed path in the tree. In this way, multiple routes can be quickly associated with a single location. Read more
Auto Trait Implementations
impl<'a, C, P> RefUnwindSafe for ScopeBuilder<'a, C, P> where
P: RefUnwindSafe,
impl<'a, C, P> Send for ScopeBuilder<'a, C, P>
impl<'a, C, P> Sync for ScopeBuilder<'a, C, P>
impl<'a, C, P> Unpin for ScopeBuilder<'a, C, P> where
C: Unpin,
impl<'a, C, P> !UnwindSafe for ScopeBuilder<'a, C, P>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more