Module chakracore::value [] [src]

Javascript values that user code can interact with.

The Value object acts as the base type for all others using dereference. Therefore all types have access to the Value type's methods and traits. Implicit traits such as Debug, must be accessed by dereferencing. For example: Function inherits Object, which in turn inherits Value. To print a function using the debug trait, you need to dereference twice.

println("Output: {:?}", **function_value);

Please note that the Debug trait should be carefully used. It relies implicitly on an active context, and that it's the same context the value was created with. Therefore it's mostly implemented to ease debugging. Prefer to_string for safety.

All created values are tied to a specific context. Because of this a ContextGuard is required whenever creating new values, and they should not be passed between different contexts.

Reexports

pub use self::function::Function;
pub use self::promise::Promise;

Modules

function

A JavaScript function and associated types.

promise

Structs

Array

A JavaScript array.

ArrayBuffer

A JavaScript array buffer.

ArrayIter

An iterator for a JavaScript array.

Boolean

A JavaScript boolean.

Error

A JavaScript error.

External

A JavaScript external object.

Number

A JavaScript number.

Object

A JavaScript object.

String

A JavaScript string.

Value

A JavaScript value, base class for all types.

Functions

false_

Creates a false value.

null

Creates a null value.

true_

Creates a true value.

undefined

Creates an undefined value.