Struct rquickjs_core::Function [−][src]
pub struct Function<'js>(_);
Expand description
Rust representation of a javascript function.
Implementations
pub fn new<F, A, R>(ctx: Ctx<'js>, func: F) -> Result<Self> where
F: AsFunction<'js, A, R> + ParallelSend + 'static,
Set the length
property
Call a function with given arguments
You can use tuples to pass arguments. The ()
treated as no arguments, the (arg,)
as a single argument and so on.
To call function on a given this
you can pass This(this)
as a first argument.
By default an undefined
will be passed as this
.
Deferred call a function with given arguments
You can use tuples to pass arguments. The ()
treated as no arguments, the (arg,)
as a single argument and so on.
To call function on a given this
you can pass This(this)
as a first argument.
By default an undefined
will be passed as this
.
Check that function is a constructor
Mark the function as a constructor
Set a function prototype
Actually this method does the following:
func.prototype = proto;
proto.constructor = func;
Get a function prototype
Actually this method returns the func.prototype
.
Convert into an object
Convert from an object
Convert into value
Convert from value
Methods from Deref<Target = Value<'js>>
Check if the value is a function
Try reinterprete as
Trait Implementations
Auto Trait Implementations
impl<'js> !RefUnwindSafe for Function<'js>
impl<'js> UnwindSafe for Function<'js>
Blanket Implementations
Mutably borrows from an owned value. Read more