pub trait Provider {
    fn timers<Q: Query>(&self, query: &mut Q) -> Result;

    fn next_expiration(&self) -> Option<Timestamp> { ... }
    fn is_armed(&self) -> bool { ... }
    fn armed_timer_count(&self) -> usize { ... }
    fn for_each_timer<F: FnMut(&Timer) -> Result>(&self, f: F) { ... }
}
Expand description

A trait for a components that owns at least one timer

Required Methods

Notifies the query of any timers owned by the provider

The provider should also delegate to subcomponents that own timers as well.

Provided Methods

Returns the next Timestamp at which the earliest timer is armed in the provider

Returns true if there are any timers armed

Counts the number of armed timers in the provider

Iterates over each timer in the provider and calls the provided function

Implementations on Foreign Types

Implement Provider for a 2-element tuple to make it easy to do joins

Implementors