Trait context_rs::ProviderFutExt
source · pub trait ProviderFutExt: Future + Sized {
fn provide<P: Provider>(self, provider: P) -> ProviderFut<Self, P> ⓘ { ... }
fn provide_ref<T: 'static + ?Sized>(
self,
value: &T
) -> ProviderFut<Self, ProvideRef<'_, T>> ⓘ { ... }
}
Expand description
Extension trait that aims to simplify the providing of values in the async context.
Provided Methods§
sourcefn provide<P: Provider>(self, provider: P) -> ProviderFut<Self, P> ⓘ
fn provide<P: Provider>(self, provider: P) -> ProviderFut<Self, P> ⓘ
Wraps a Future
so it can provide values into the async context.
sourcefn provide_ref<T: 'static + ?Sized>(
self,
value: &T
) -> ProviderFut<Self, ProvideRef<'_, T>> ⓘ
fn provide_ref<T: 'static + ?Sized>(
self,
value: &T
) -> ProviderFut<Self, ProvideRef<'_, T>> ⓘ
Wraps a Future
so it can provide this ref into the async context.
Can be cloned from the context using take_value