pub(crate) trait Callback: JSTraceable + MallocSizeOf {
// Required method
fn callback(&self, cx: &mut CurrentRealm<'_>, v: HandleValue<'_>);
}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.