Struct actix_router::RouterBuilder
source · [−]pub struct RouterBuilder<T, U = ()> { /* private fields */ }
Expand description
Builder for an ordered routing list.
Implementations
sourceimpl<T, U> RouterBuilder<T, U>
impl<T, U> RouterBuilder<T, U>
sourcepub fn push(
&mut self,
rdef: ResourceDef,
val: T,
ctx: U
) -> (&mut ResourceDef, &mut T, &mut U)
pub fn push(
&mut self,
rdef: ResourceDef,
val: T,
ctx: U
) -> (&mut ResourceDef, &mut T, &mut U)
Adds a new route to the end of the routing list.
Returns mutable references to elements of the new route.
sourceimpl<T, U> RouterBuilder<T, U>where
U: Default,
impl<T, U> RouterBuilder<T, U>where
U: Default,
Convenience methods provided when context data impls Default
sourcepub fn path(
&mut self,
path: impl IntoPatterns,
val: T
) -> (&mut ResourceDef, &mut T, &mut U)
pub fn path(
&mut self,
path: impl IntoPatterns,
val: T
) -> (&mut ResourceDef, &mut T, &mut U)
Registers resource for specified path.
sourcepub fn prefix(
&mut self,
prefix: impl IntoPatterns,
val: T
) -> (&mut ResourceDef, &mut T, &mut U)
pub fn prefix(
&mut self,
prefix: impl IntoPatterns,
val: T
) -> (&mut ResourceDef, &mut T, &mut U)
Registers resource for specified path prefix.
sourcepub fn rdef(
&mut self,
rdef: ResourceDef,
val: T
) -> (&mut ResourceDef, &mut T, &mut U)
pub fn rdef(
&mut self,
rdef: ResourceDef,
val: T
) -> (&mut ResourceDef, &mut T, &mut U)
Registers resource for ResourceDef
.
Auto Trait Implementations
impl<T, U> RefUnwindSafe for RouterBuilder<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for RouterBuilder<T, U>where
T: Send,
U: Send,
impl<T, U> Sync for RouterBuilder<T, U>where
T: Sync,
U: Sync,
impl<T, U> Unpin for RouterBuilder<T, U>where
T: Unpin,
U: Unpin,
impl<T, U> UnwindSafe for RouterBuilder<T, U>where
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more