Struct rquickjs::prelude::Async

source ·
pub struct Async<T>(pub T);
Expand description

Helper type for creating a function from a closure which returns a future.

Tuple Fields§

§0: T

Trait Implementations§

source§

impl<'js, R, Fun, Fut> IntoJsFunc<'js, ()> for Async<Fun>
where Fun: Fn() -> Fut + 'js, (): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut> IntoJsFunc<'js, ()> for Async<MutFn<Fun>>
where Fun: FnMut() -> Fut + 'js, (): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut> IntoJsFunc<'js, ()> for Async<OnceFn<Fun>>
where Fun: FnOnce() -> Fut + 'js, (): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A> IntoJsFunc<'js, (A,)> for Async<Fun>
where Fun: Fn(A) -> Fut + 'js, (A,): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A> IntoJsFunc<'js, (A,)> for Async<MutFn<Fun>>
where Fun: FnMut(A) -> Fut + 'js, (A,): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A> IntoJsFunc<'js, (A,)> for Async<OnceFn<Fun>>
where Fun: FnOnce(A) -> Fut + 'js, (A,): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B> IntoJsFunc<'js, (A, B)> for Async<Fun>
where Fun: Fn(A, B) -> Fut + 'js, (A, B): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B> IntoJsFunc<'js, (A, B)> for Async<MutFn<Fun>>
where Fun: FnMut(A, B) -> Fut + 'js, (A, B): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B> IntoJsFunc<'js, (A, B)> for Async<OnceFn<Fun>>
where Fun: FnOnce(A, B) -> Fut + 'js, (A, B): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C> IntoJsFunc<'js, (A, B, C)> for Async<Fun>
where Fun: Fn(A, B, C) -> Fut + 'js, (A, B, C): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C> IntoJsFunc<'js, (A, B, C)> for Async<MutFn<Fun>>
where Fun: FnMut(A, B, C) -> Fut + 'js, (A, B, C): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C> IntoJsFunc<'js, (A, B, C)> for Async<OnceFn<Fun>>
where Fun: FnOnce(A, B, C) -> Fut + 'js, (A, B, C): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D> IntoJsFunc<'js, (A, B, C, D)> for Async<Fun>
where Fun: Fn(A, B, C, D) -> Fut + 'js, (A, B, C, D): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D> IntoJsFunc<'js, (A, B, C, D)> for Async<MutFn<Fun>>
where Fun: FnMut(A, B, C, D) -> Fut + 'js, (A, B, C, D): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D> IntoJsFunc<'js, (A, B, C, D)> for Async<OnceFn<Fun>>
where Fun: FnOnce(A, B, C, D) -> Fut + 'js, (A, B, C, D): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E> IntoJsFunc<'js, (A, B, C, D, E)> for Async<Fun>
where Fun: Fn(A, B, C, D, E) -> Fut + 'js, (A, B, C, D, E): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E> IntoJsFunc<'js, (A, B, C, D, E)> for Async<MutFn<Fun>>
where Fun: FnMut(A, B, C, D, E) -> Fut + 'js, (A, B, C, D, E): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E> IntoJsFunc<'js, (A, B, C, D, E)> for Async<OnceFn<Fun>>
where Fun: FnOnce(A, B, C, D, E) -> Fut + 'js, (A, B, C, D, E): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E, F> IntoJsFunc<'js, (A, B, C, D, E, F)> for Async<Fun>
where Fun: Fn(A, B, C, D, E, F) -> Fut + 'js, (A, B, C, D, E, F): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E, F> IntoJsFunc<'js, (A, B, C, D, E, F)> for Async<MutFn<Fun>>
where Fun: FnMut(A, B, C, D, E, F) -> Fut + 'js, (A, B, C, D, E, F): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E, F> IntoJsFunc<'js, (A, B, C, D, E, F)> for Async<OnceFn<Fun>>
where Fun: FnOnce(A, B, C, D, E, F) -> Fut + 'js, (A, B, C, D, E, F): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E, F, G> IntoJsFunc<'js, (A, B, C, D, E, F, G)> for Async<Fun>
where Fun: Fn(A, B, C, D, E, F, G) -> Fut + 'js, (A, B, C, D, E, F, G): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E, F, G> IntoJsFunc<'js, (A, B, C, D, E, F, G)> for Async<MutFn<Fun>>
where Fun: FnMut(A, B, C, D, E, F, G) -> Fut + 'js, (A, B, C, D, E, F, G): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E, F, G> IntoJsFunc<'js, (A, B, C, D, E, F, G)> for Async<OnceFn<Fun>>
where Fun: FnOnce(A, B, C, D, E, F, G) -> Fut + 'js, (A, B, C, D, E, F, G): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E, F, G, H> IntoJsFunc<'js, (A, B, C, D, E, F, G, H)> for Async<Fun>
where Fun: Fn(A, B, C, D, E, F, G, H) -> Fut + 'js, (A, B, C, D, E, F, G, H): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E, F, G, H> IntoJsFunc<'js, (A, B, C, D, E, F, G, H)> for Async<MutFn<Fun>>
where Fun: FnMut(A, B, C, D, E, F, G, H) -> Fut + 'js, (A, B, C, D, E, F, G, H): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.
source§

impl<'js, R, Fun, Fut, A, B, C, D, E, F, G, H> IntoJsFunc<'js, (A, B, C, D, E, F, G, H)> for Async<OnceFn<Fun>>
where Fun: FnOnce(A, B, C, D, E, F, G, H) -> Fut + 'js, (A, B, C, D, E, F, G, H): FromParams<'js> + 'js, Fut: Future<Output = R> + 'js, R: IntoJs<'js> + 'js,

source§

fn param_requirements() -> ParamRequirement

Returns the requirements this function has for the set of arguments used to call this function.
source§

fn call(&self, params: Params<'_, 'js>) -> Result<Value<'js>, Error>

Call the function with the given parameters.

Auto Trait Implementations§

§

impl<T> Freeze for Async<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Async<T>
where T: RefUnwindSafe,

§

impl<T> Send for Async<T>
where T: Send,

§

impl<T> Sync for Async<T>
where T: Sync,

§

impl<T> Unpin for Async<T>
where T: Unpin,

§

impl<T> UnwindSafe for Async<T>
where T: 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

§

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>,

§

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.
source§

impl<T> ParallelSend for T
where T: Send,