Expand description
Cached provider
A provider that calls the underlying provider on the first call and returns the result of that on all calls
Implementations
sourceimpl<'cx, S, F> Cached<'cx, S, F>where
S: Service,
F: Fn(&'cx Context<'_>) -> S::Output<'cx> + 'cx,
impl<'cx, S, F> Cached<'cx, S, F>where
S: Service,
F: Fn(&'cx Context<'_>) -> S::Output<'cx> + 'cx,
sourcepub fn new_fn(provider: F) -> Self
pub fn new_fn(provider: F) -> Self
Equivelant to calling Cached::new with a provider wrapped in a
provider_fn type hint
Trait Implementations
Auto Trait Implementations
impl<'cx, S, P> RefUnwindSafe for Cached<'cx, S, P>where
P: RefUnwindSafe,
<S as Service>::Output<'cx>: UnwindSafe + RefUnwindSafe,
impl<'cx, S, P> Send for Cached<'cx, S, P>where
P: Send,
<S as Service>::Output<'cx>: Send,
impl<'cx, S, P> Sync for Cached<'cx, S, P>where
P: Sync,
<S as Service>::Output<'cx>: Send + Sync,
impl<'cx, S, P> Unpin for Cached<'cx, S, P>where
P: Unpin,
<S as Service>::Output<'cx>: Unpin,
impl<'cx, S, P> UnwindSafe for Cached<'cx, S, P>where
P: UnwindSafe,
<S as Service>::Output<'cx>: 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