pub struct Router<Handle = PipeHandle> { /* private fields */ }Implementations§
Source§impl<Handle> Router<Handle>
impl<Handle> Router<Handle>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn add(&mut self, mount: Mount<Handle>)
pub fn remove(&mut self, pattern: &str) -> usize
pub fn replace(&mut self, pattern: &str, mount: Mount<Handle>) -> bool
pub fn route(&self, request: &Request<Bytes>) -> Option<&Mount<Handle>>
Sourcepub fn route_with_params(
&self,
request: &Request<Bytes>,
) -> Option<(&Mount<Handle>, BTreeMap<String, String>)>
pub fn route_with_params( &self, request: &Request<Bytes>, ) -> Option<(&Mount<Handle>, BTreeMap<String, String>)>
Find a matching mount and return the extracted path params.
pub fn mounts(&self) -> &[Mount<Handle>]
Trait Implementations§
Auto Trait Implementations§
impl<Handle> Freeze for Router<Handle>
impl<Handle> RefUnwindSafe for Router<Handle>
impl<Handle> Send for Router<Handle>
impl<Handle> Sync for Router<Handle>
impl<Handle> Unpin for Router<Handle>
impl<Handle> UnsafeUnpin for Router<Handle>
impl<Handle> UnwindSafe for Router<Handle>
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