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§

source

fn timers<Q>(&self, query: &mut Q) -> Result<(), QueryBreak>
where Q: Query,

Notifies the query of any timers owned by the provider

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

Provided Methods§

source

fn next_expiration(&self) -> Option<Timestamp>

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

source

fn is_armed(&self) -> bool

Returns true if there are any timers armed

source

fn armed_timer_count(&self) -> usize

Counts the number of armed timers in the provider

source

fn for_each_timer<F>(&self, f: F)
where F: FnMut(&Timer) -> Result<(), QueryBreak>,

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)
where A: Provider, B: Provider,

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

source§

fn timers<Q>(&self, query: &mut Q) -> Result<(), QueryBreak>
where Q: Query,

source§

impl<T> Provider for Option<T>
where T: Provider,

source§

fn timers<Q>(&self, query: &mut Q) -> Result<(), QueryBreak>
where Q: Query,

source§

impl<T> Provider for &T
where T: Provider,

source§

fn timers<Q>(&self, query: &mut Q) -> Result<(), QueryBreak>
where Q: Query,

source§

impl<T> Provider for &mut T
where T: Provider,

source§

fn timers<Q>(&self, query: &mut Q) -> Result<(), QueryBreak>
where Q: Query,

Implementors§

source§

impl Provider for s2n_quic_core::path::ecn::Controller

source§

impl Provider for s2n_quic_core::path::mtu::Controller

source§

impl Provider for Pto

source§

impl Provider for Timer

source§

impl Provider for TokenBucket

source§

impl<'a, C: Client<'a>> Provider for s2n_netbench::client::Driver<'a, C>

source§

impl<'a, C: Connection> Provider for s2n_netbench::Driver<'a, C>

source§

impl<K> Provider for KeySet<K>