pub struct Asyncify<F>(pub F);
Expand description
Turns a synchronous function into a type that implements Injectable
.
Tuple Fields
0: F
Trait Implementations
sourceimpl<Func, Input, Output> Injectable<Input, Output, ()> for Asyncify<Func> where
Input: Send + Sync,
Func: Fn() -> Output + Send + Sync + 'static,
Output: Send + 'static,
impl<Func, Input, Output> Injectable<Input, Output, ()> for Asyncify<Func> where
Input: Send + Sync,
Func: Fn() -> Output + Send + Sync + 'static,
Output: Send + 'static,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
sourceimpl<Func, Input, Output, A, B, C, D, E, F, G, H, I> Injectable<Input, Output, (A, B, C, D, E, F, G, H, I)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E> + DependencySupplier<F> + DependencySupplier<G> + DependencySupplier<H> + DependencySupplier<I>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E, F, G, H, I) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
F: Clone + Send + Sync,
G: Clone + Send + Sync,
H: Clone + Send + Sync,
I: Clone + Send + Sync,
impl<Func, Input, Output, A, B, C, D, E, F, G, H, I> Injectable<Input, Output, (A, B, C, D, E, F, G, H, I)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E> + DependencySupplier<F> + DependencySupplier<G> + DependencySupplier<H> + DependencySupplier<I>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E, F, G, H, I) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
F: Clone + Send + Sync,
G: Clone + Send + Sync,
H: Clone + Send + Sync,
I: Clone + Send + Sync,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
sourceimpl<Func, Input, Output, A, B, C, D, E, F, G, H> Injectable<Input, Output, (A, B, C, D, E, F, G, H)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E> + DependencySupplier<F> + DependencySupplier<G> + DependencySupplier<H>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E, F, G, H) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
F: Clone + Send + Sync,
G: Clone + Send + Sync,
H: Clone + Send + Sync,
impl<Func, Input, Output, A, B, C, D, E, F, G, H> Injectable<Input, Output, (A, B, C, D, E, F, G, H)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E> + DependencySupplier<F> + DependencySupplier<G> + DependencySupplier<H>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E, F, G, H) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
F: Clone + Send + Sync,
G: Clone + Send + Sync,
H: Clone + Send + Sync,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
sourceimpl<Func, Input, Output, A, B, C, D, E, F, G> Injectable<Input, Output, (A, B, C, D, E, F, G)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E> + DependencySupplier<F> + DependencySupplier<G>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E, F, G) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
F: Clone + Send + Sync,
G: Clone + Send + Sync,
impl<Func, Input, Output, A, B, C, D, E, F, G> Injectable<Input, Output, (A, B, C, D, E, F, G)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E> + DependencySupplier<F> + DependencySupplier<G>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E, F, G) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
F: Clone + Send + Sync,
G: Clone + Send + Sync,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
sourceimpl<Func, Input, Output, A, B, C, D, E, F> Injectable<Input, Output, (A, B, C, D, E, F)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E> + DependencySupplier<F>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E, F) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
F: Clone + Send + Sync,
impl<Func, Input, Output, A, B, C, D, E, F> Injectable<Input, Output, (A, B, C, D, E, F)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E> + DependencySupplier<F>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E, F) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
F: Clone + Send + Sync,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
sourceimpl<Func, Input, Output, A, B, C, D, E> Injectable<Input, Output, (A, B, C, D, E)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
impl<Func, Input, Output, A, B, C, D, E> Injectable<Input, Output, (A, B, C, D, E)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D> + DependencySupplier<E>,
Input: Send + Sync,
Func: Fn(A, B, C, D, E) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
E: Clone + Send + Sync,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
sourceimpl<Func, Input, Output, A, B, C, D> Injectable<Input, Output, (A, B, C, D)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D>,
Input: Send + Sync,
Func: Fn(A, B, C, D) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
impl<Func, Input, Output, A, B, C, D> Injectable<Input, Output, (A, B, C, D)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C> + DependencySupplier<D>,
Input: Send + Sync,
Func: Fn(A, B, C, D) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
D: Clone + Send + Sync,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
sourceimpl<Func, Input, Output, A, B, C> Injectable<Input, Output, (A, B, C)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C>,
Input: Send + Sync,
Func: Fn(A, B, C) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
impl<Func, Input, Output, A, B, C> Injectable<Input, Output, (A, B, C)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B> + DependencySupplier<C>,
Input: Send + Sync,
Func: Fn(A, B, C) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
C: Clone + Send + Sync,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
sourceimpl<Func, Input, Output, A, B> Injectable<Input, Output, (A, B)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B>,
Input: Send + Sync,
Func: Fn(A, B) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
impl<Func, Input, Output, A, B> Injectable<Input, Output, (A, B)> for Asyncify<Func> where
Input: DependencySupplier<A> + DependencySupplier<B>,
Input: Send + Sync,
Func: Fn(A, B) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
B: Clone + Send + Sync,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
sourceimpl<Func, Input, Output, A> Injectable<Input, Output, (A,)> for Asyncify<Func> where
Input: DependencySupplier<A>,
Input: Send + Sync,
Func: Fn(A) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
impl<Func, Input, Output, A> Injectable<Input, Output, (A,)> for Asyncify<Func> where
Input: DependencySupplier<A>,
Input: Send + Sync,
Func: Fn(A) -> Output + Send + Sync + 'static,
Output: Send + 'static,
A: Clone + Send + Sync,
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>
Auto Trait Implementations
impl<F> RefUnwindSafe for Asyncify<F> where
F: RefUnwindSafe,
impl<F> Send for Asyncify<F> where
F: Send,
impl<F> Sync for Asyncify<F> where
F: Sync,
impl<F> Unpin for Asyncify<F> where
F: Unpin,
impl<F> UnwindSafe for Asyncify<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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