Struct Asyncify

Source
pub struct Asyncify<F>(pub F);
Expand description

Turns a synchronous function into a type that implements Injectable.

Tuple Fields§

§0: F

Trait Implementations§

Source§

impl<Func, Output> Injectable<Output, ()> for Asyncify<Func>
where Func: Fn() -> Output + Send + Sync + 'static, Output: Send + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1> Injectable<Output, (T1,)> for Asyncify<Func>
where Func: Fn(T1) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2> Injectable<Output, (T1, T2)> for Asyncify<Func>
where Func: Fn(T1, T2) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3> Injectable<Output, (T1, T2, T3)> for Asyncify<Func>
where Func: Fn(T1, T2, T3) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3, T4> Injectable<Output, (T1, T2, T3, T4)> for Asyncify<Func>
where Func: Fn(T1, T2, T3, T4) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static, T4: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3, T4, T5> Injectable<Output, (T1, T2, T3, T4, T5)> for Asyncify<Func>
where Func: Fn(T1, T2, T3, T4, T5) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static, T4: Clone + Send + Sync + 'static, T5: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3, T4, T5, T6> Injectable<Output, (T1, T2, T3, T4, T5, T6)> for Asyncify<Func>
where Func: Fn(T1, T2, T3, T4, T5, T6) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static, T4: Clone + Send + Sync + 'static, T5: Clone + Send + Sync + 'static, T6: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3, T4, T5, T6, T7> Injectable<Output, (T1, T2, T3, T4, T5, T6, T7)> for Asyncify<Func>
where Func: Fn(T1, T2, T3, T4, T5, T6, T7) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static, T4: Clone + Send + Sync + 'static, T5: Clone + Send + Sync + 'static, T6: Clone + Send + Sync + 'static, T7: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3, T4, T5, T6, T7, T8> Injectable<Output, (T1, T2, T3, T4, T5, T6, T7, T8)> for Asyncify<Func>
where Func: Fn(T1, T2, T3, T4, T5, T6, T7, T8) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static, T4: Clone + Send + Sync + 'static, T5: Clone + Send + Sync + 'static, T6: Clone + Send + Sync + 'static, T7: Clone + Send + Sync + 'static, T8: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3, T4, T5, T6, T7, T8, T9> Injectable<Output, (T1, T2, T3, T4, T5, T6, T7, T8, T9)> for Asyncify<Func>
where Func: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static, T4: Clone + Send + Sync + 'static, T5: Clone + Send + Sync + 'static, T6: Clone + Send + Sync + 'static, T7: Clone + Send + Sync + 'static, T8: Clone + Send + Sync + 'static, T9: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Injectable<Output, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for Asyncify<Func>
where Func: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static, T4: Clone + Send + Sync + 'static, T5: Clone + Send + Sync + 'static, T6: Clone + Send + Sync + 'static, T7: Clone + Send + Sync + 'static, T8: Clone + Send + Sync + 'static, T9: Clone + Send + Sync + 'static, T10: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Injectable<Output, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> for Asyncify<Func>
where Func: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static, T4: Clone + Send + Sync + 'static, T5: Clone + Send + Sync + 'static, T6: Clone + Send + Sync + 'static, T7: Clone + Send + Sync + 'static, T8: Clone + Send + Sync + 'static, T9: Clone + Send + Sync + 'static, T10: Clone + Send + Sync + 'static, T11: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more
Source§

impl<Func, Output, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Injectable<Output, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> for Asyncify<Func>
where Func: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) -> Output + Send + Sync + 'static, Output: Send + 'static, T1: Clone + Send + Sync + 'static, T2: Clone + Send + Sync + 'static, T3: Clone + Send + Sync + 'static, T4: Clone + Send + Sync + 'static, T5: Clone + Send + Sync + 'static, T6: Clone + Send + Sync + 'static, T7: Clone + Send + Sync + 'static, T8: Clone + Send + Sync + 'static, T9: Clone + Send + Sync + 'static, T10: Clone + Send + Sync + 'static, T11: Clone + Send + Sync + 'static, T12: Clone + Send + Sync + 'static,

Source§

fn inject<'a>(&'a self, container: &'a DependencyMap) -> CompiledFn<'a, Output>

Source§

fn input_types() -> BTreeSet<Type>

Returns the set of types that this function depends on. Used only for run-time “type checking”.
Source§

fn obligations() -> BTreeMap<Type, &'static Location<'static>>

Returns the map of obligations of this function. Read more

Auto Trait Implementations§

§

impl<F> Freeze for Asyncify<F>
where F: Freeze,

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.