Struct Map
pub struct Map<T, Req>
where
T: Target<Req>, { /* private fields */ }
A map caching MakeServices per key.
Create one with the [Map::builder()].
Implementations
impl Map<StartHere, StartHere>
fn builder<Dst>() -> Builder<Dst, WantsKeyer, WantsServiceMaker>Create a
Builderto configure a newMap.
impl<T, Req> Map<T, Req>
where
T: Target<Req>,
T::Key: Eq + Hash,
fn service(&mut self, req: &Req) -> &mut T::ServiceGet a service after extracting the key from
req.fn retain<F>(&mut self, predicate: F) where F: FnMut(&T::Key, &mut T::Service) -> bool,Retains only the services specified by the predicate.
fn clear(&mut self)Clears the map, removing all key-value pairs.
Auto Trait Implementations
impl<T, Req> Freeze for Map<T, Req>
where
HashMap<<T as Target<Req>>::Key, <T as Target<Req>>::Service>: Freeze,
T: Freeze,
impl<T, Req> RefUnwindSafe for Map<T, Req>
where
HashMap<<T as Target<Req>>::Key, <T as Target<Req>>::Service>: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Req> Send for Map<T, Req>
where
HashMap<<T as Target<Req>>::Key, <T as Target<Req>>::Service>: Send,
T: Send,
impl<T, Req> Sync for Map<T, Req>
where
HashMap<<T as Target<Req>>::Key, <T as Target<Req>>::Service>: Sync,
T: Sync,
impl<T, Req> Unpin for Map<T, Req>
where
HashMap<<T as Target<Req>>::Key, <T as Target<Req>>::Service>: Unpin,
T: Unpin,
impl<T, Req> UnsafeUnpin for Map<T, Req>
where
HashMap<<T as Target<Req>>::Key, <T as Target<Req>>::Service>: UnsafeUnpin,
T: UnsafeUnpin,
impl<T, Req> UnwindSafe for Map<T, Req>
where
HashMap<<T as Target<Req>>::Key, <T as Target<Req>>::Service>: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for Map<T, Req>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Map<T, Req>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Map<T, Req>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Map<T, Req>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for Map<T, Req>
impl<T> WithSubscriber for Map<T, Req>
impl<T, U> Into<U> for Map<T, Req>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Map<T, Req>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Map<T, Req>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>