pub struct ReadyCallback(/* private fields */);Expand description
A reusable callback invoked when a readiness scope receives a notification.
Register with crate::BindCtx::on_notify or crate::Pipeline::on_notify.
The callback runs synchronously when ReadyNotifier::notify reaches the
registered scope, including notifications from dependencies and notifications
received while already invalid. It does not run for successful checks,
ordinary task wakeups, cached calls, or internal readiness resets.
The argument is the receiving scope’s user data, configured with
crate::ReadyBinding::with_data, or 0 by default. Propagation delivers
each scope’s own value, not the originating scope’s value. Pipeline roots
always supply 0. One callback can be shared by scopes with different data.
Clones share one callback identity. Registering the same handle repeatedly on a scope is idempotent. Repeated notifier subscriptions can invoke it more than once per notification. Each scope retains its registration until it is dropped, including across completed or cancelled checks.
Callbacks run after their scope is invalidated and its parents are visited, before its observers are woken. Later subscribers and unvisited ancestors may still be ready. Delivery borrows scope and callback storage in place, without snapshots or cloning callback handles. Registering callbacks on a scope currently executing callbacks, modifying borrowed scope storage, or notifying any source during delivery panics. Registrations on other scopes can take effect in the current notification.
Captures must be owned. Avoid capturing a pipeline that retains this callback
or other strong references that would create a reference cycle.
This type is neither Send nor Sync.