mozjs::gc

Trait Rootable

source
pub trait Rootable: Sized + Traceable {
    const VTABLE: RootedVFTable = _;

    // Provided method
    unsafe extern "C" fn trace(
        this: *mut c_void,
        trc: *mut JSTracer,
        _name: *const i8,
    ) { ... }
}
Expand description

Marker trait that allows any type that implements the [trace::Traceable] trait to be used with the Rooted type.

Rooted<T> relies on dynamic dispatch in C++ when T uses the Traceable RootKind. This trait initializes the vtable when creating a Rust instance of the Rooted object.

Provided Associated Constants§

Provided Methods§

source

unsafe extern "C" fn trace( this: *mut c_void, trc: *mut JSTracer, _name: *const i8, )

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> Rootable for Option<T>
where T: Rootable,

Implementors§