Trait rquickjs_core::AsFunction[][src]

pub trait AsFunction<'js, A, R> {
    fn num_args() -> Range<usize>;
fn call(&self, input: &Input<'js>) -> Result<Value<'js>>; fn post<'js_>(_ctx: Ctx<'js_>, _func: &Function<'js_>) -> Result<()> { ... } }

The trait to wrap rust function to JS directly

Required methods

fn num_args() -> Range<usize>[src]

The possible range of function arguments

fn call(&self, input: &Input<'js>) -> Result<Value<'js>>[src]

Call as JS function

Loading content...

Provided methods

fn post<'js_>(_ctx: Ctx<'js_>, _func: &Function<'js_>) -> Result<()>[src]

Post-processing the function

Loading content...

Implementations on Foreign Types

impl<'js, F1, A1, R1, F2, A2, R2> AsFunction<'js, (A1, A2), (R1, R2)> for (F1, F2) where
    F1: AsFunction<'js, A1, R1> + ParallelSend + 'static,
    F2: AsFunction<'js, A2, R2> + ParallelSend + 'static, 
[src]

impl<'js, F1, A1, R1, F2, A2, R2, F3, A3, R3> AsFunction<'js, (A1, A2, A3), (R1, R2, R3)> for (F1, F2, F3) where
    F1: AsFunction<'js, A1, R1> + ParallelSend + 'static,
    F2: AsFunction<'js, A2, R2> + ParallelSend + 'static,
    F3: AsFunction<'js, A3, R3> + ParallelSend + 'static, 
[src]

impl<'js, F1, A1, R1, F2, A2, R2, F3, A3, R3, F4, A4, R4> AsFunction<'js, (A1, A2, A3, A4), (R1, R2, R3, R4)> for (F1, F2, F3, F4) where
    F1: AsFunction<'js, A1, R1> + ParallelSend + 'static,
    F2: AsFunction<'js, A2, R2> + ParallelSend + 'static,
    F3: AsFunction<'js, A3, R3> + ParallelSend + 'static,
    F4: AsFunction<'js, A4, R4> + ParallelSend + 'static, 
[src]

impl<'js, F1, A1, R1, F2, A2, R2, F3, A3, R3, F4, A4, R4, F5, A5, R5> AsFunction<'js, (A1, A2, A3, A4, A5), (R1, R2, R3, R4, R5)> for (F1, F2, F3, F4, F5) where
    F1: AsFunction<'js, A1, R1> + ParallelSend + 'static,
    F2: AsFunction<'js, A2, R2> + ParallelSend + 'static,
    F3: AsFunction<'js, A3, R3> + ParallelSend + 'static,
    F4: AsFunction<'js, A4, R4> + ParallelSend + 'static,
    F5: AsFunction<'js, A5, R5> + ParallelSend + 'static, 
[src]

impl<'js, F1, A1, R1, F2, A2, R2, F3, A3, R3, F4, A4, R4, F5, A5, R5, F6, A6, R6> AsFunction<'js, (A1, A2, A3, A4, A5, A6), (R1, R2, R3, R4, R5, R6)> for (F1, F2, F3, F4, F5, F6) where
    F1: AsFunction<'js, A1, R1> + ParallelSend + 'static,
    F2: AsFunction<'js, A2, R2> + ParallelSend + 'static,
    F3: AsFunction<'js, A3, R3> + ParallelSend + 'static,
    F4: AsFunction<'js, A4, R4> + ParallelSend + 'static,
    F5: AsFunction<'js, A5, R5> + ParallelSend + 'static,
    F6: AsFunction<'js, A6, R6> + ParallelSend + 'static, 
[src]

Loading content...

Implementors

impl<'js, C, F, A, R> AsFunction<'js, A, R> for Constructor<C, F> where
    C: ClassDef + ParallelSend + 'static,
    F: AsFunction<'js, A, R> + ParallelSend + 'static, 
[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> 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, (), R> for MutFn<F> where
    F: FnMut() -> R + ParallelSend + 'static,
    R: IntoJs<'js>, 
[src]

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

impl<'js, F, R> AsFunction<'js, (), R> for F where
    F: Fn() -> R + ParallelSend + 'static,
    R: IntoJs<'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, 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,), R> for MutFn<F> where
    F: FnMut(A) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    A: FromInput<'js>, 
[src]

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

impl<'js, F, R, A> AsFunction<'js, (A,), R> for F where
    F: Fn(A) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    A: 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, 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), R> for MutFn<F> where
    F: FnMut(A, B) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>, 
[src]

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

impl<'js, F, R, A, B> AsFunction<'js, (A, B), R> for F where
    F: Fn(A, B) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    A: FromInput<'js>,
    B: 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, 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), R> for MutFn<F> where
    F: FnMut(A, B, D) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>, 
[src]

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

impl<'js, F, R, A, B, D> AsFunction<'js, (A, B, D), R> for F where
    F: Fn(A, B, D) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: 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, 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), R> for MutFn<F> where
    F: FnMut(A, B, D, E) -> R + ParallelSend + 'static,
    R: 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), R> for OnceFn<F> where
    F: FnOnce(A, B, D, E) -> R + ParallelSend + 'static,
    R: 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), R> for F where
    F: Fn(A, B, D, E) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: 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, 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), R> for MutFn<F> where
    F: FnMut(A, B, D, E, G) -> R + ParallelSend + 'static,
    R: 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), R> for OnceFn<F> where
    F: FnOnce(A, B, D, E, G) -> R + ParallelSend + 'static,
    R: 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), R> for F where
    F: Fn(A, B, D, E, G) -> R + ParallelSend + 'static,
    R: 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, 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, 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), R> for MutFn<F> where
    F: FnMut(A, B, D, E, G, H) -> R + ParallelSend + 'static,
    R: 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), R> for OnceFn<F> where
    F: FnOnce(A, B, D, E, G, H) -> R + ParallelSend + 'static,
    R: 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), R> for F where
    F: Fn(A, B, D, E, G, H) -> R + ParallelSend + 'static,
    R: 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, 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<'js, F, R, T> AsFunction<'js, (T,), R> for Method<F> where
    F: Fn(T) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    T: FromJs<'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, A> AsFunction<'js, (T, A), R> for Method<F> where
    F: Fn(T, A) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    T: FromJs<'js>,
    A: 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, B> AsFunction<'js, (T, A, B), R> for Method<F> where
    F: Fn(T, A, B) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    T: FromJs<'js>,
    A: FromInput<'js>,
    B: 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, D> AsFunction<'js, (T, A, B, D), R> for Method<F> where
    F: Fn(T, A, B, D) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    T: FromJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: 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, E> AsFunction<'js, (T, A, B, D, E), R> for Method<F> where
    F: Fn(T, A, B, D, E) -> R + ParallelSend + 'static,
    R: 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, 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, G> AsFunction<'js, (T, A, B, D, E, G), R> for Method<F> where
    F: Fn(T, A, B, D, E, G) -> R + ParallelSend + 'static,
    R: 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, 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, H> AsFunction<'js, (T, A, B, D, E, G, H), R> for Method<F> where
    F: Fn(T, A, B, D, E, G, H) -> R + ParallelSend + 'static,
    R: IntoJs<'js>,
    T: FromJs<'js>,
    A: FromInput<'js>,
    B: FromInput<'js>,
    D: FromInput<'js>,
    E: FromInput<'js>,
    G: FromInput<'js>,
    H: FromInput<'js>, 
[src]

Loading content...