pub struct ContextRoute<'a> { /* private fields */ }Expand description
Handle returned after registering a route on ContextRoutes, supporting fluent chaining.
Implementations§
Source§impl<'a> ContextRoute<'a>
impl<'a> ContextRoute<'a>
Sourcepub fn name(self, short_name: &str) -> Self
pub fn name(self, short_name: &str) -> Self
Names the route relative to the active context and module (e.g. index -> api.chat.index),
recording its RouteEntry into ContextRegistry.
pub fn middleware(self, middleware: impl IntoMiddleware) -> Self
pub fn without_middleware<M: 'static>(self) -> Self
pub fn with_head(self, head: Head) -> Self
pub fn scope_bindings(self) -> Self
pub fn without_scoped_bindings(self) -> Self
pub fn route(&mut self) -> &mut Route
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ContextRoute<'a>
impl<'a> !UnwindSafe for ContextRoute<'a>
impl<'a> Forget for ContextRoute<'a>
impl<'a> Freeze for ContextRoute<'a>where
&'a mut Route: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const ArcInner<Mutex<ContextRegistry>> is !null: Freeze,
PhantomData<ArcInner<Mutex<ContextRegistry>>>: Freeze,
impl<'a> Move for ContextRoute<'a>
impl<'a> Send for ContextRoute<'a>where
RawVecInner: Send,
BoxRaw<[u8]>: Send,
TypeId: Send,
&'static str: Send,
Arc<dyn Fn(MethodRouter) -> MethodRouter + Sync + Send>: Send,
Arc<dyn Fn(Router) -> Router + Sync + Send>: Send,
Arc<dyn Chained>: Send,
RawTable<usize>: Send,
NonZero<u16>: Send,
BoxRaw<dyn CloneService<Request<Body>, Error = !, Response = Response<Body>, Future = Pin<Box<dyn Future<Output = Result<Response<Body>, !>> + Send>>> + Sync + Send>: Send,
BoxRaw<dyn ErasedIntoRoute<(), !>>: Send,
BytesMut: Send,
&'static Location<'static>: Send,
Arc<Mutex<ContextRegistry>>: Send,
impl<'a> Sync for ContextRoute<'a>where
RawVecInner: Sync,
BoxRaw<[u8]>: Sync,
TypeId: Sync,
Arc<dyn Fn(MethodRouter) -> MethodRouter + Sync + Send>: Sync,
Arc<dyn Fn(Router) -> Router + Sync + Send>: Sync,
Arc<dyn Chained>: Sync,
RawTable<usize>: Sync,
NonZero<u16>: Sync,
BoxRaw<dyn CloneService<Request<Body>, Error = !, Response = Response<Body>, Future = Pin<Box<dyn Future<Output = Result<Response<Body>, !>> + Send>>> + Sync + Send>: Sync,
BoxRaw<dyn ErasedIntoRoute<(), !>>: Sync,
BytesMut: Sync,
Location<'static>: Sync,
Arc<Mutex<ContextRegistry>>: Sync,
impl<'a> Unpin for ContextRoute<'a>
impl<'a> UnsafeUnpin for ContextRoute<'a>where
&'a mut Route: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ArcInner<Mutex<ContextRegistry>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<ContextRegistry>>>: UnsafeUnpin,
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