Struct rquickjs_core::Async[][src]

#[repr(transparent)]pub struct Async<F>(pub F);
This is supported on crate feature futures only.

The wrapper for async functons

This type wraps returned future into Promised

async fn my_func() {}
let func = Function::new(ctx, Async(my_func));

Trait Implementations

impl<'js, F, R> AsFunction<'js, (), Promised<R>> for Async<F> where
    F: Fn() -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>, 
[src]

impl<'js, F, R> AsFunction<'js, (), Promised<R>> for Async<MutFn<F>> where
    F: FnMut() -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>, 
[src]

impl<'js, F, R> AsFunction<'js, (), Promised<R>> for Async<OnceFn<F>> where
    F: FnOnce() -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>, 
[src]

impl<'js, F, R, A, B, D, E, G, H> AsFunction<'js, (A, B, D, E, G, H), Promised<R>> for Async<F> where
    F: Fn(A, B, D, E, G, H) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>,
    G: FromInput<'js>,
    H: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D, E, G, H> AsFunction<'js, (A, B, D, E, G, H), Promised<R>> for Async<MutFn<F>> where
    F: FnMut(A, B, D, E, G, H) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>,
    G: FromInput<'js>,
    H: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D, E, G, H> AsFunction<'js, (A, B, D, E, G, H), Promised<R>> for Async<OnceFn<F>> where
    F: FnOnce(A, B, D, E, G, H) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>,
    G: FromInput<'js>,
    H: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D, E, G> AsFunction<'js, (A, B, D, E, G), Promised<R>> for Async<F> where
    F: Fn(A, B, D, E, G) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>,
    G: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D, E, G> AsFunction<'js, (A, B, D, E, G), Promised<R>> for Async<MutFn<F>> where
    F: FnMut(A, B, D, E, G) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>,
    G: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D, E, G> AsFunction<'js, (A, B, D, E, G), Promised<R>> for Async<OnceFn<F>> where
    F: FnOnce(A, B, D, E, G) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>,
    G: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D, E> AsFunction<'js, (A, B, D, E), Promised<R>> for Async<F> where
    F: Fn(A, B, D, E) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D, E> AsFunction<'js, (A, B, D, E), Promised<R>> for Async<MutFn<F>> where
    F: FnMut(A, B, D, E) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D, E> AsFunction<'js, (A, B, D, E), Promised<R>> for Async<OnceFn<F>> where
    F: FnOnce(A, B, D, E) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D> AsFunction<'js, (A, B, D), Promised<R>> for Async<F> where
    F: Fn(A, B, D) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D> AsFunction<'js, (A, B, D), Promised<R>> for Async<MutFn<F>> where
    F: FnMut(A, B, D) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>, 
[src]

impl<'js, F, R, A, B, D> AsFunction<'js, (A, B, D), Promised<R>> for Async<OnceFn<F>> where
    F: FnOnce(A, B, D) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>, 
[src]

impl<'js, F, R, A, B> AsFunction<'js, (A, B), Promised<R>> for Async<F> where
    F: Fn(A, B) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>, 
[src]

impl<'js, F, R, A, B> AsFunction<'js, (A, B), Promised<R>> for Async<MutFn<F>> where
    F: FnMut(A, B) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>, 
[src]

impl<'js, F, R, A, B> AsFunction<'js, (A, B), Promised<R>> for Async<OnceFn<F>> where
    F: FnOnce(A, B) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>,
    B: FromInput<'js>, 
[src]

impl<'js, F, R, A> AsFunction<'js, (A,), Promised<R>> for Async<F> where
    F: Fn(A) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>, 
[src]

impl<'js, F, R, A> AsFunction<'js, (A,), Promised<R>> for Async<MutFn<F>> where
    F: FnMut(A) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>, 
[src]

impl<'js, F, R, A> AsFunction<'js, (A,), Promised<R>> for Async<OnceFn<F>> where
    F: FnOnce(A) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    A: FromInput<'js>, 
[src]

impl<'js, F, R, T, A, B, D, E, G, H> AsFunction<'js, (T, A, B, D, E, G, H), Promised<R>> for Async<Method<F>> where
    F: Fn(T, A, B, D, E, G, H) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    T: FromJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>,
    G: FromInput<'js>,
    H: FromInput<'js>, 
[src]

impl<'js, F, R, T, A, B, D, E, G> AsFunction<'js, (T, A, B, D, E, G), Promised<R>> for Async<Method<F>> where
    F: Fn(T, A, B, D, E, G) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    T: FromJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>,
    G: FromInput<'js>, 
[src]

impl<'js, F, R, T, A, B, D, E> AsFunction<'js, (T, A, B, D, E), Promised<R>> for Async<Method<F>> where
    F: Fn(T, A, B, D, E) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    T: FromJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>, 
[src]

impl<'js, F, R, T, A, B, D> AsFunction<'js, (T, A, B, D), Promised<R>> for Async<Method<F>> where
    F: Fn(T, A, B, D) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    T: FromJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>, 
[src]

impl<'js, F, R, T, A, B> AsFunction<'js, (T, A, B), Promised<R>> for Async<Method<F>> where
    F: Fn(T, A, B) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    T: FromJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>, 
[src]

impl<'js, F, R, T, A> AsFunction<'js, (T, A), Promised<R>> for Async<Method<F>> where
    F: Fn(T, A) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    T: FromJs<'js>,
    A: FromInput<'js>, 
[src]

impl<'js, F, R, T> AsFunction<'js, (T,), Promised<R>> for Async<Method<F>> where
    F: Fn(T) -> R + ParallelSend + 'static,
    R: Future + ParallelSend + 'static,
    R::Output: for<'js_> IntoJs<'js_>,
    T: FromJs<'js>, 
[src]

impl<F> AsRef<F> for Async<F>[src]

impl<F> Deref for Async<F>[src]

type Target = F

The resulting type after dereferencing.

Auto Trait Implementations

impl<F> RefUnwindSafe for Async<F> where
    F: RefUnwindSafe
[src]

impl<F> Send for Async<F> where
    F: Send
[src]

impl<F> Sync for Async<F> where
    F: Sync
[src]

impl<F> Unpin for Async<F> where
    F: Unpin
[src]

impl<F> UnwindSafe for Async<F> where
    F: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.