pub enum CleanupTrigger {
OnRerun,
OnDeactivation,
OnInvalidate,
}Expand description
Lifecycle trigger discriminator for BindingBoundary::cleanup_for.
Slice E2 (R2.4.5 / Lock 4.A / Lock 4.A′) — the named-hook cleanup spec
returned by user fns has three independent slots; Core fires each slot
at its own lifecycle moment via cleanup_for(node_id, CleanupTrigger).
All three triggers fire lock-released per Slice E D045 handshake
discipline. The binding is responsible for resolving the trigger to its
stored cleanup closure (typically a node_id → NodeFnCleanup map) and
invoking the matching slot.
Variants§
OnRerun
R2.4.5 onRerun — fires before the next fn run within the same
activation cycle. Core fires this in fire_regular between the
lock-held dep-snapshot phase and the lock-released invoke_fn call,
gated on has_fired_once == true (so first-fire never sees an
onRerun). The user closure receives no arguments and is expected
to release fn-local resources from the previous run before the
fresh invoke_fn allocates new ones.
OnDeactivation
R2.4.5 onDeactivation — fires when subscriber count drops to
zero. Core fires this from Subscription::Drop (alongside the
existing BindingBoundary::producer_deactivate call), gated on
has_fired_once == true. Order: cleanup-first (OnDeactivation)
then producer_deactivate, because cleanup may release handles the
producer subscription owns (D056). Per D059, bindings SHOULD clear
current_cleanup on this trigger — the next subscribe + first-fire
will re-register a fresh closure.
OnInvalidate
R2.4.5 onInvalidate — fires when an [[INVALIDATE]] arrives at
the node and clears its cache. Per R1.3.9.b strict reading
(D057): fires at most once per wave per node, regardless of
fan-in shape. Per R1.3.9.c: never fires when the node’s cache
is the never-populated sentinel (a node that has not yet emitted
has nothing to clean up). Per D058: fires at cache-clear time,
not at wire-delivery time — pause buffering doesn’t defer the
hook. Per D061: when the wave is panic-discarded mid-flight,
queued OnInvalidate hooks are dropped silently (the cleanup never
fires for the panicked wave); see BindingBoundary::cleanup_for
rustdoc for the panic-discard guarantee gap and the bindings’
idempotent-cleanup recommendation.
Trait Implementations§
Source§impl Clone for CleanupTrigger
impl Clone for CleanupTrigger
Source§fn clone(&self) -> CleanupTrigger
fn clone(&self) -> CleanupTrigger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CleanupTrigger
impl Debug for CleanupTrigger
Source§impl Hash for CleanupTrigger
impl Hash for CleanupTrigger
Source§impl PartialEq for CleanupTrigger
impl PartialEq for CleanupTrigger
Source§fn eq(&self, other: &CleanupTrigger) -> bool
fn eq(&self, other: &CleanupTrigger) -> bool
self and other values to be equal, and is used by ==.impl Copy for CleanupTrigger
impl Eq for CleanupTrigger
impl StructuralPartialEq for CleanupTrigger
Auto Trait Implementations§
impl Freeze for CleanupTrigger
impl RefUnwindSafe for CleanupTrigger
impl Send for CleanupTrigger
impl Sync for CleanupTrigger
impl Unpin for CleanupTrigger
impl UnsafeUnpin for CleanupTrigger
impl UnwindSafe for CleanupTrigger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.