Struct rquickjs_core::Method [−][src]
The wrapper for method functions
The method-like functions is functions which get this
as the first argument. This wrapper allows receive this
directly as first argument and do not requires using This
for that purpose.
let func = Function::new(ctx, Method(|this: i32, factor: i32| { this * factor }))?; assert_eq!(func.call::<_, i32>((This(3), 2))?, 6);
Trait Implementations
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]
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>,
fn num_args() -> Range<usize>
[src]
fn call(&self, input: &Input<'js>) -> Result<Value<'js>>
[src]
fn post<'js_>(_ctx: Ctx<'js_>, _func: &Function<'js_>) -> Result<()>
[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]
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>,
fn num_args() -> Range<usize>
[src]
fn call(&self, input: &Input<'js>) -> Result<Value<'js>>
[src]
fn post<'js_>(_ctx: Ctx<'js_>, _func: &Function<'js_>) -> Result<()>
[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]
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>,
fn num_args() -> Range<usize>
[src]
fn call(&self, input: &Input<'js>) -> Result<Value<'js>>
[src]
fn post<'js_>(_ctx: Ctx<'js_>, _func: &Function<'js_>) -> Result<()>
[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]
F: Fn(T, A, B, D) -> R + ParallelSend + 'static,
R: IntoJs<'js>,
T: FromJs<'js>,
A: FromInput<'js>,
B: FromInput<'js>,
D: FromInput<'js>,
fn num_args() -> Range<usize>
[src]
fn call(&self, input: &Input<'js>) -> Result<Value<'js>>
[src]
fn post<'js_>(_ctx: Ctx<'js_>, _func: &Function<'js_>) -> Result<()>
[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]
F: Fn(T, A, B) -> R + ParallelSend + 'static,
R: IntoJs<'js>,
T: FromJs<'js>,
A: FromInput<'js>,
B: FromInput<'js>,
fn num_args() -> Range<usize>
[src]
fn call(&self, input: &Input<'js>) -> Result<Value<'js>>
[src]
fn post<'js_>(_ctx: Ctx<'js_>, _func: &Function<'js_>) -> Result<()>
[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]
F: Fn(T, A) -> R + ParallelSend + 'static,
R: IntoJs<'js>,
T: FromJs<'js>,
A: FromInput<'js>,
fn num_args() -> Range<usize>
[src]
fn call(&self, input: &Input<'js>) -> Result<Value<'js>>
[src]
fn post<'js_>(_ctx: Ctx<'js_>, _func: &Function<'js_>) -> Result<()>
[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]
F: Fn(T) -> R + ParallelSend + 'static,
R: IntoJs<'js>,
T: FromJs<'js>,
fn num_args() -> Range<usize>
[src]
fn call(&self, input: &Input<'js>) -> Result<Value<'js>>
[src]
fn post<'js_>(_ctx: Ctx<'js_>, _func: &Function<'js_>) -> Result<()>
[src]
impl<F> AsRef<F> for Method<F>
[src]
impl<F> Deref for Method<F>
[src]
Auto Trait Implementations
impl<F> RefUnwindSafe for Method<F> where
F: RefUnwindSafe,
[src]
F: RefUnwindSafe,
impl<F> Send for Method<F> where
F: Send,
[src]
F: Send,
impl<F> Sync for Method<F> where
F: Sync,
[src]
F: Sync,
impl<F> Unpin for Method<F> where
F: Unpin,
[src]
F: Unpin,
impl<F> UnwindSafe for Method<F> where
F: UnwindSafe,
[src]
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,