Type Alias JSObjectFinalizeCallback

Source
pub type JSObjectFinalizeCallback = Option<unsafe extern "C" fn(object: JSObjectRef)>;
Expand description

The callback invoked when an object is finalized (prepared for garbage collection). An object may be finalized on any thread.

If you named your function Finalize, you would declare it like this:

void
Finalize(JSObjectRef object);

The finalize callback is called on the most derived class first, and the least derived class (the parent class) last.

You must not call any function that may cause a garbage collection or an allocation of a garbage collected object from within a JSObjectFinalizeCallback. This includes all functions that have a JSContextRef parameter.

Aliased Type§

pub enum JSObjectFinalizeCallback {
    None,
    Some(unsafe extern "C" fn(*mut OpaqueJSValue)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*mut OpaqueJSValue))

Some value of type T.