mozjs::gc::custom

Trait CustomAutoTraceable

Source
unsafe trait CustomAutoTraceable: Sized {
    const vftable: CustomAutoRooterVFTable = _;

    // Required method
    fn do_trace(&self, trc: *mut JSTracer);

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

CustomAutoRooter uses dynamic dispatch on the C++ side for custom tracing, so provide trace logic via vftable when creating an object on Rust side.

Provided Associated Constants§

Required Methods§

Source

fn do_trace(&self, trc: *mut JSTracer)

Used by CustomAutoTraceable implementer to trace its contents. Corresponds to virtual trace call in a CustomAutoRooter subclass (C++).

Provided Methods§

Source

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

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§