Handle

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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

Source§

type Data = T

Source§

impl<T> Handle for &Global<T>

Source§

type Data = T

Source§

impl<T> Handle for Global<T>

Source§

type Data = T

Source§

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

Source§

type Data = T