Crate boa_macros

Crate boa_macros 

Source
Expand description

Macros for the Boa JavaScript engine.

§About Boa

Boa is an open-source, experimental ECMAScript Engine written in Rust for lexing, parsing and executing ECMAScript/JavaScript. Currently, Boa supports some of the language. More information can be viewed at Boa’s website.

Try out the most recent release with Boa’s live demo playground.

§Boa Crates

  • boa_cli - Boa’s CLI && REPL implementation
  • boa_ast - Boa’s ECMAScript Abstract Syntax Tree.
  • boa_engine - Boa’s implementation of ECMAScript builtin objects and execution.
  • boa_gc - Boa’s garbage collector.
  • boa_icu_provider - Boa’s ICU4X data provider.
  • boa_interner - Boa’s string interner.
  • boa_macros - Boa’s macros.
  • boa_parser - Boa’s lexer and parser.
  • boa_runtime - Boa’s WebAPI features.
  • boa_string - Boa’s ECMAScript string implementation.
  • tag_ptr - Utility library that enables a pointer to be associated with a tag of type usize.
  • small_btree - Utility library that adds the SmallBTreeMap data structure.

Macros§

embed_module_inner
Implementation of the inner iterator of the embed_module! macro. All arguments are required.
js_object
Create a JsObject object from a simpler DSL that resembles JSON.
js_str
Convert a utf8 string literal to a JsString
js_value
The js_value! macro creates a JsValue instance based on a JSON-like DSL.
utf16
Construct a utf-16 array literal from a utf-8 str literal.

Attribute Macros§

boa_class
boa_class proc macro attribute that applies to an impl XYZ block and add a [boa_engine::JsClass] implementation for it.
boa_module
boa_module proc macro attribute for declaring a boa_engine::Module based on a Rust module. The original Rust module will also be exposed as is.

Derive Macros§

Finalize
Derive the Finalize trait.
JsData
Derive the JsData trait.
Trace
Derive the Trace trait.
TryFromJs
Derives the TryFromJs trait, with the #[boa()] attribute.
TryIntoJs
Derives the TryIntoJs trait, with the #[boa()] attribute.