Trait s2n_netbench::timer::Provider
source · pub trait Provider {
// Required method
fn timers<Q>(&self, query: &mut Q) -> Result<(), QueryBreak>
where Q: Query;
// Provided methods
fn next_expiration(&self) -> Option<Timestamp> { ... }
fn is_armed(&self) -> bool { ... }
fn armed_timer_count(&self) -> usize { ... }
fn for_each_timer<F>(&self, f: F)
where F: FnMut(&Timer) -> Result<(), QueryBreak> { ... }
}
Expand description
A trait for a components that owns at least one timer
Required Methods§
Provided Methods§
sourcefn next_expiration(&self) -> Option<Timestamp>
fn next_expiration(&self) -> Option<Timestamp>
Returns the next Timestamp
at which the earliest timer is armed in the provider
sourcefn armed_timer_count(&self) -> usize
fn armed_timer_count(&self) -> usize
Counts the number of armed timers in the provider
sourcefn for_each_timer<F>(&self, f: F)
fn for_each_timer<F>(&self, f: F)
Iterates over each timer in the provider and calls the provided function
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<A, B> Provider for (A, B)
impl<A, B> Provider for (A, B)
Implement Provider for a 2-element tuple to make it easy to do joins