Struct v8::Global

source · []
pub struct Global<T> { /* private fields */ }
Expand description

An object reference that is independent of any handle scope. Where a Local handle only lives as long as the HandleScope in which it was allocated, a global handle remains valid until it is explicitly disposed using reset().

A global handle contains a reference to a storage cell within the V8 engine which holds an object value and which is updated by the garbage collector whenever the object is moved.

Implementations

Construct a new Global from an existing Handle.

Consume this Global and return the underlying raw pointer.

The returned raw pointer must be converted back into a Global by using Global::from_raw, otherwise the V8 value referenced by this global handle will be pinned on the V8 heap permanently and never get garbage collected.

Converts a raw pointer created with Global::into_raw() back to its original Global.

Trait Implementations

Immutably borrows from an owned value. 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

Executes the destructor for this type. Read more

Returns a reference to the V8 heap object that this handle represents. The handle does not get cloned, nor is it converted to a Local handle. Read more

Reads the inner value contained in this handle, without verifying that the this handle is hosted by the currently active Isolate. Read more

Returns a reference to the V8 heap object that this handle represents. The handle does not get cloned, nor is it converted to a Local handle. Read more

Reads the inner value contained in this handle, without verifying that the this handle is hosted by the currently active Isolate. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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.