Trait Provider

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

    // Provided methods
    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§

Source

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

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: FnMut(&Timer) -> Result>(&self, f: F)

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<A: Provider, B: Provider> Provider for (A, B)

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

Source§

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

Source§

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

Source§

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

Source§

impl<T: Provider> Provider for &T

Source§

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

Source§

impl<T: Provider> Provider for &mut T

Source§

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

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 TokenBucket

Source§

impl Provider for Timer

Source§

impl<K> Provider for KeySet<K>