script_bindings::import::module::typedarray

Trait JSObjectStorage

Source
pub trait JSObjectStorage {
    // Required methods
    fn as_raw(&self) -> *mut JSObject;
    fn from_raw(raw: *mut JSObject) -> Self;
}
Expand description

Trait that specifies how pointers to wrapped objects are stored. It supports two variants, one with bare pointer (to be rooted on stack using CustomAutoRooter) and wrapped in a Box<Heap>, which can be stored in a heap-allocated structure, to be rooted with JSTraceable-implementing tracers (currently implemented in Servo).

Required Methods§

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.

Implementations on Foreign Types§

Source§

impl JSObjectStorage for *mut JSObject

Source§

impl JSObjectStorage for Box<Heap<*mut JSObject>>

Implementors§