pub struct TimerCell { /* private fields */ }Expand description
Reactive single-shot timer: projects TimerCore’s fire edge onto a cell so
has_fired/value dependents invalidate only on the fire (idempotent).
Implementations§
Source§impl TimerCell
impl TimerCell
pub fn new(ctx: &Context, fire_at: u64) -> Self
Sourcepub fn tick(&self, ctx: &Context, now: u64) -> bool
pub fn tick(&self, ctx: &Context, now: u64) -> bool
Advance to logical time now; returns the fire edge. On a fire the
backing cell flips to true (the PartialEq store-guard makes a repeat
tick a no-op, so dependents invalidate exactly once).
Sourcepub fn value(&self, ctx: &Context) -> Option<()>
pub fn value(&self, ctx: &Context) -> Option<()>
None before the fire, Some(()) after (reactive read).
Sourcepub fn fired_cell(&self) -> Source<bool>
pub fn fired_cell(&self) -> Source<bool>
The backing cell, for dependents that want to subscribe directly.
pub fn next_fire(&self) -> Option<u64>
Auto Trait Implementations§
impl !Freeze for TimerCell
impl !RefUnwindSafe for TimerCell
impl !Sync for TimerCell
impl Send for TimerCell
impl Unpin for TimerCell
impl UnsafeUnpin for TimerCell
impl UnwindSafe for TimerCell
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
Mutably borrows from an owned value. Read more