pub struct Every<M: Send + 'static> { /* private fields */ }Expand description
Implementations§
Source§impl<M: Send + 'static> Every<M>
impl<M: Send + 'static> Every<M>
Sourcepub fn new(
interval: Duration,
make_msg: impl Fn() -> M + Send + Sync + 'static,
) -> Self
pub fn new( interval: Duration, make_msg: impl Fn() -> M + Send + Sync + 'static, ) -> Self
Create a tick subscription with the given interval and message factory.
Sourcepub fn with_id(
id: SubId,
interval: Duration,
make_msg: impl Fn() -> M + Send + Sync + 'static,
) -> Self
pub fn with_id( id: SubId, interval: Duration, make_msg: impl Fn() -> M + Send + Sync + 'static, ) -> Self
Create a tick subscription with an explicit ID.
Sourcepub fn with_clock(
id: SubId,
interval: Duration,
clock: LabClock,
make_msg: impl Fn() -> M + Send + Sync + 'static,
) -> Self
pub fn with_clock( id: SubId, interval: Duration, clock: LabClock, make_msg: impl Fn() -> M + Send + Sync + 'static, ) -> Self
Create a tick subscription driven by a deterministic ftui_core::cx::LabClock.
Sourcepub fn poll_virtual(
&self,
clock: &LabClock,
last_tick: &mut Instant,
sender: &SubscriptionSender<M>,
) -> Option<usize>
pub fn poll_virtual( &self, clock: &LabClock, last_tick: &mut Instant, sender: &SubscriptionSender<M>, ) -> Option<usize>
Fire any due ticks against clock since last_tick, advancing last_tick
by self.interval for each emitted tick. Returns None if the receiver
disconnected.
Trait Implementations§
Auto Trait Implementations§
impl<M> !RefUnwindSafe for Every<M>
impl<M> !UnwindSafe for Every<M>
impl<M> Forget for Every<M>
impl<M> Freeze for Every<M>
impl<M> Move for Every<M>
impl<M> Send for Every<M>
impl<M> Sync for Every<M>
impl<M> Unpin for Every<M>
impl<M> UnsafeUnpin for Every<M>
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