Function lignin::callback_registry::reset_callback_registry[][src]

pub unsafe fn reset_callback_registry() -> Result<(), ()>
Expand description

Tries to rewind the total callback registration counter to zero.

Errors

Should that fail (because there are still callbacks registered), the counter is instead set to the lowest value that ensures no colliding CallbackRegistration.

Safety

The caller (generally a renderer) must ensure that no currently existing CallbackRefs created from a dropped CallbackRegistration can have their .call(…) function invoked during or after this call.

See Also

yet_more_unsafe_force_clear_callback_registry, which yet-more-unsafely ignores CallbackRegistrations that haven’t been dropped yet.