pub struct Function<'js>(_);
Expand description

Rust representation of a javascript function.

Implementations

Set the length property

Set the name 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.

Reference as an object

Convert into an object

Convert from an object

Reference to value

Convert into value

Convert from value

Methods from Deref<Target = Value<'js>>

Try get bool from value

Try get int from value

Try get float from value

Try get any number from value

Check if the value is a bool

Check if the value is an int

Check if the value is a float

Check if the value is an any number

Check if the value is a string

Check if the value is a symbol

Check if the value is an object

Check if the value is a module

Check if the value is an array

Check if the value is a function

Check if the value is an error

Reference as value

Convert from value to specified type

Get the type of value

Get the name of type

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

Try reinterprete as

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

Try reinterprete as

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

Try reinterprete as

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

Try reinterprete as

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

Try reinterprete as

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

Try reinterprete as

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Converts to this type from the input type.

The target which has the same type as a Self but with another lifetime 't

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Property configuration Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.