Expand description
Interop utilities between Boa and its host.
Re-exports§
pub use boa_engine;pub use boa_macros;
Modules§
- loaders
- A collection of JS
boa_engine::module::ModuleLoaders utilities to help in creating custom module loaders. - macros
- Module declaring interop macro rules.
Macros§
- __count
- Internal macro to get the JavaScript class length.
- __
get_ set_ decl - Internal macro to declare a getter/setter name.
- __
js_ class_ name - Internal macro to get the JavaScript class name.
- embed_
module - Create a module loader that embeds files from the filesystem at build time. This is useful for bundling assets with the binary.
- js_
class - Declare a JavaScript class, in a simpler way.
Structs§
- Context
Data - Captures a
ContextDatadata from theContextas a JS function argument, based on its type. - Ignore
- An argument that would be ignored in a JS function. This is equivalent of typing
()in Rust functions argument, but more explicit. - JsAll
- An argument that when used in a JS function will capture all
the arguments that can be converted to
T. The first argument that cannot be converted toTwill stop the conversion. - JsClass
- Captures a class instance from the
thisvalue in a JS function. The class will be a non-mutable reference of Rust typeT, if it is an instance ofT. - JsRest
- An argument that when used in a JS function will empty the list
of JS arguments as
JsValues. This can be used for having the rest of the arguments in a function. It should be the last argument of your function, before theContextargument if any. - JsThis
- Captures the
thisvalue in a JS function. Although this can be specified multiple times as argument, it will always be filled with clone of the same value.
Traits§
- Into
JsFunction Copied - The safe equivalent of the
UnsafeIntoJsFunctiontrait. This can only be used on closures that have theCopytrait. - Into
JsModule - A trait to convert a type into a JS module.
- TryFrom
JsArgument - Create a Rust value from a JS argument. This trait is used to convert arguments from JS to Rust types. It allows support for optional arguments or rest arguments.
- Unsafe
Into JsFunction - A trait to convert a type into a JS function.
This trait does not require the implementing type to be
Copy, which can lead to undefined behaviour if it contains Garbage Collected objects.