mozjs::jsapi

Type Alias RootedObject

Source
pub type RootedObject = Rooted<*mut JSObject>;
Expand description

Local variable of type T whose value is always rooted. This is typically used for local variables, or for non-rooted values being passed to a function that requires a handle, e.g. Foo(Root(cx, x)).

If you want to add additional methods to Rooted for a specific specialization, define a RootedOperations specialization containing them.

Aliased Type§

struct RootedObject {
    pub vtable: (),
    pub base: RootedBase,
    pub ptr: MaybeUninit<*mut JSObject>,
}

Fields§

§vtable: ()§base: RootedBase§ptr: MaybeUninit<*mut JSObject>

The rooted value

This will be initialied iff there is a RootedGuard for this Rooted

Implementations

Source§

impl<T> Rooted<T>
where T: RootKind,

Source

pub fn new_unrooted() -> Rooted<T>

Source

pub unsafe fn add_to_root_stack(&mut self, cx: *mut JSContext)

Source

pub unsafe fn remove_from_root_stack(&mut self)