Struct pendulum::Pendulum
[−]
[src]
pub struct Pendulum<T> { /* fields omitted */ }Pendulum which represents a timer that stores timeouts for items of type T.
Methods
impl<T> Pendulum<T>[src]
fn insert_timeout(
&mut self,
timeout: Duration,
item: T
) -> PendulumResult<Token, T>[src]
&mut self,
timeout: Duration,
item: T
) -> PendulumResult<Token, T>
Insert a timeout with the given duration and the given item into the Pendulum.
fn remove_timeout(&mut self, token: Token) -> Option<T>[src]
Removes the timeout corresponding with the given Token, if one exists.
fn expired_timeout(&mut self) -> Option<T>[src]
Retrive the next expired timeout from the Pendulum.
This is a non-blocking operation.
fn ticker(&self) -> &PendulumTicker[src]
Retrive a (cloneable) reference to the ticker assocaited with this Pendulum.
fn max_capacity(&self) -> usize[src]
Maximum capacity supported by this Pendulum.
fn max_timeout(&self) -> Duration[src]
Maximum timeout supported by this Pendulum.
Trait Implementations
impl<T> From<PendulumBuilder> for Pendulum<T>[src]
fn from(builder: PendulumBuilder) -> Pendulum<T>[src]
Performs the conversion.