Skip to main content

Rootable

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, )

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> Rootable for Box<T>
where T: Traceable,

Source§

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

Source§

impl<T> Rootable for Vec<T>
where T: Traceable,

Source§

impl<T> Rootable for VecDeque<T>
where T: Traceable,

Implementors§