Trait script::dom::promisenativehandler::Callback
source · pub trait Callback: JSTraceable + MallocSizeOf {
// Required method
fn callback(
&self,
cx: SafeJSContext,
v: HandleValue<'_>,
realm: InRealm<'_>,
can_gc: CanGc,
);
}
Expand description
Types that implement the Callback
trait follow the same rooting requirements
as types that use the #[dom_struct]
attribute.
Prefer storing Dom<T>
members inside them instead of DomRoot<T>
to minimize redundant work by the garbage collector.