Trait v8::Handle

source ·
pub trait Handle: Sized {
    type Data;

    // Provided methods
    fn open<'a>(&'a self, isolate: &mut Isolate) -> &'a Self::Data { ... }
    unsafe fn get_unchecked(&self) -> &Self::Data { ... }
}

Required Associated Types§

Provided Methods§

source

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.
source

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, 's: 'a, T> Handle for &'a Local<'s, T>

§

type Data = T

source§

impl<'a, T> Handle for &'a Global<T>

§

type Data = T

source§

impl<'s, T> Handle for Local<'s, T>

§

type Data = T

source§

impl<T> Handle for Global<T>

§

type Data = T