Module lignin::callback_registry[][src]

Expand description

Callback registry plumbing, for renderers and app runners that support them and need to run indefinitely.

When not using this module directly, apps, if they enable the "callbacks" feature, run out of unique callback IDs after more than four billion total CallbackRegistration::new calls across all threads in a single run of the program. As such, you probably don’t need to access this module, but if you do then it’s available.

Macros

if_callbacks

Canonically located at callback_registry::if_callbacks.
Identity iff the "callbacks" feature is enabled, otherwise empty output.
In most cases, prefer using the ENABLED constant to always check all of your code.

if_not_callbacks

Canonically located at callback_registry::if_not_callbacks.
Identity iff the "callbacks" feature is not enabled, otherwise empty output.
In most cases, prefer using the ENABLED constant to always check all of your code.

Structs

CallbackRef

Vdom A callback reference linked to a CallbackRegistration.

CallbackRegistration

A callback registration handle that should be held onto by the matching receiver R or a container with pin-projection towards that value.

Constants

ENABLED

Indicates whether the "callbacks" feature is enabled.

Traits

CallbackSignature

Marks function pointers for which callbacks are implemented.

ToRefThreadBoundFallback

Provides a fallback alternative implementation to CallbackRegistration::to_ref for use in macro frameworks.

Functions

registry_exhaustion

Indicates how exhausted the global callback registry is on a linear scale, with 0 indicating no or very low exhaustion and 255 indicating almost complete or complete exhaustion.

reset_callback_registry

Tries to rewind the total callback registration counter to zero.

when_unlocked_locally

Causes a continuation to be called when the callback registry is not locked (anymore) by the current thread.

yet_more_unsafe_force_clear_callback_registry

Clears the callback registry entirely and resets the total callback registration counter to zero.