Struct chakracore::value::Boolean [] [src]

pub struct Boolean(_);

A JavaScript boolean.

Methods

impl Boolean
[src]

Creates a new boolean.

Converts a JavaScript boolean to a bool.

Returns true if the value is a Boolean.

impl Boolean
[src]

Creates an instance from a raw pointer.

This is used for managing the lifetime of JSRT objects. They are tracked using reference counting; incrementing with from_raw, and decrementing with drop.

This is required to support items stored on the heap, since the JSRT runtime only observes the stack.

If used in conjunction with a Property or any Value, it is assumed a Context is active.

Returns the underlying raw pointer.

Methods from Deref<Target = Value>

Returns true if this value is undefined.

Returns true if this value is null.

Returns true if this value is a Number.

Represent the value as a Number. Does not affect the underlying value.

Returns true if this value is a String.

Represent the value as a String. Does not affect the underlying value.

Returns true if this value is a Boolean.

Represent the value as a Boolean. Does not affect the underlying value.

Returns true if this value is an Object.

Represent the value as an Object. Does not affect the underlying value.

Returns true if this value is an External.

Represent the value as an External. Does not affect the underlying value.

Returns true if this value is a Function.

Represent the value as a Function. Does not affect the underlying value.

Returns true if this value is an Array.

Represent the value as an Array. Does not affect the underlying value.

Returns true if this value is an ArrayBuffer.

Represent the value as an ArrayBuffer. Does not affect the underlying value.

Returns true if this value is a Promise.

Represent the value as a Promise. Does not affect the underlying value.

Converts the value to a native string, containing the value's string representation.

Converts the value to a native integer, containing the value's integer representation.

Converts the value to a native double, containing the value's floating point representation.

Converts the value to a native boolean, containing the value's bool representation.

Converts the value to a native string, containing the value's JSON representation.

Creates a new boolean with this value represented as Boolean.

Creates a new number with this value represented as Number.

Creates a new object with this value represented as Object.

Creates a new string with this value represented as String.

Returns the type of the value. This method should be used with consideration. It does not keep track of custom types, such as External. It only returns the runtime's definition of a type.

Compare two values for equality (==).

Compare two values for strict equality (===).

Returns the underlying raw pointer.

Trait Implementations

impl Clone for Boolean
[src]

Duplicates a reference counted type.

The underlying pointer will be copied, and its reference count will be incremented, returned wrapped as the type.

Performs copy-assignment from source. Read more

impl Drop for Boolean
[src]

Decrements the reference counter if the object is recyclable.

impl Deref for Boolean
[src]

The resulting type after dereferencing

The method called to dereference a value