Enum boa::js::value::ValueData

source ·
pub enum ValueData {
    Null,
    Undefined,
    Boolean(bool),
    String(String),
    Number(f64),
    Integer(i32),
    Object(GcCell<ObjectData>),
    Function(GcCell<Function>),
}
Expand description

A Javascript value

Variants

Null

null - A null value, for when a value doesn’t exist

Undefined

undefined - An undefined value, for when a field or index doesn’t exist

Boolean(bool)

boolean - A true / false value, for if a certain criteria is met

String(String)

String - A UTF-8 string, such as "Hello, world"

Number(f64)

Number - A 64-bit floating point number, such as 3.1415

Integer(i32)

Number - A 32-bit integer, such as 42

Object(GcCell<ObjectData>)

Object - An object, such as Math, represented by a binary tree of string keys to Javascript values

Function(GcCell<Function>)

Function - A runnable block of code, such as Math.sqrt, which can take some variables and return a useful value or act upon an object

Implementations

Returns a new empty object

Returns true if the value is an object

Returns true if the value is undefined

Returns true if the value is null

Returns true if the value is null or undefined

Returns true if the value is a 64-bit floating-point number

Returns true if the value is a string

Returns true if the value is true toBoolean

Converts the value into a 64-bit floating point number

Converts the value into a 32-bit integer

Resolve the property in the object Returns a copy of the Property

Resolve the property in the object and get its value, or undefined if this is not an object or the field doesn’t exist

Resolve the property in the object and get its value, or undefined if this is not an object or the field doesn’t exist

Set the field in the value

Set the field in the value

Set the property in the value

Set the property in the value

Convert from a JSON value to a JS value

Get the type of the value

Trait Implementations

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
The resulting type after applying the | operator.
Performs the | operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
Executes the destructor for this type. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the ! operator.
Performs the unary ! operation. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the << operator.
Performs the << operation. Read more
The resulting type after applying the >> operator.
Performs the >> operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
Marks all contained Gcs.
Increments the root-count of all contained Gcs.
Decrements the root-count of all contained Gcs.
Runs Finalize::finalize() on this object and all contained subobjects Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. 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
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. 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.