Struct rusty_v8::Local [−][src]
#[repr(C)]pub struct Local<'s, T>(_, _);
Expand description
An object reference managed by the v8 garbage collector.
All objects returned from v8 have to be tracked by the garbage collector so that it knows that the objects are still alive. Also, because the garbage collector may move objects, it is unsafe to point directly to an object. Instead, all objects are stored in handles which are known by the garbage collector and updated whenever an object moves. Handles should always be passed by value (except in cases like out-parameters) and they should never be allocated on the heap.
There are two types of handles: local and persistent handles.
Local handles are light-weight and transient and typically used in
local operations. They are managed by HandleScopes. That means that a
HandleScope must exist on the stack when they are created and that they are
only valid inside of the HandleScope
active during their creation.
For passing a local handle to an outer HandleScope
, an
EscapableHandleScope
and its Escape()
method must be used.
Persistent handles can be used when storing objects across several independent operations and have to be explicitly deallocated when they’re no longer used.
It is safe to extract the object stored in the handle by dereferencing the handle (for instance, to extract the *Object from a Local
Note: Local handles in Rusty V8 differ from the V8 C++ API in that they are
never empty. In situations where empty handles are needed, use
Option
Implementations
Construct a new Local from an existing Handle.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
type Data = T
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
type Data = T
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
Auto Trait Implementations
impl<'s, T> RefUnwindSafe for Local<'s, T> where
T: RefUnwindSafe,
impl<'s, T> UnwindSafe for Local<'s, T> where
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more