pub trait Handle: Sized {
type Data;
fn open<'a>(&'a self, isolate: &mut Isolate) -> &'a Self::Data { ... }
unsafe fn get_unchecked(&self) -> &Self::Data { ... }
}
Required Associated Types§
Provided Methods§
sourcefn open<'a>(&'a self, isolate: &mut Isolate) -> &'a Self::Data
fn open<'a>(&'a self, isolate: &mut Isolate) -> &'a Self::Data
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.
Panics
This function panics in the following situations:
- The handle is not hosted by the specified Isolate.
- The Isolate that hosts this handle has been disposed.
sourceunsafe fn get_unchecked(&self) -> &Self::Data
unsafe fn get_unchecked(&self) -> &Self::Data
Reads the inner value contained in this handle, without verifying that
the this handle is hosted by the currently active Isolate
.
Safety
Using a V8 heap object with another Isolate
than the Isolate
that
hosts it is not permitted under any circumstance. Doing so leads to
undefined behavior, likely a crash.
Panics
This function panics if the Isolate
that hosts the handle has been
disposed.