Struct sozu_lib::timer::TimeoutContainer
source · pub struct TimeoutContainer { /* private fields */ }
Implementations§
source§impl TimeoutContainer
impl TimeoutContainer
pub fn new(duration: Duration, token: Token) -> TimeoutContainer
pub fn new_empty(duration: Duration) -> TimeoutContainer
pub fn take(&mut self) -> TimeoutContainer
sourcepub fn triggered(&mut self)
pub fn triggered(&mut self)
must be called when a timeout was triggered, to prevent errors when canceling
pub fn set(&mut self, token: Token)
sourcepub fn set_duration(&mut self, duration: Duration)
pub fn set_duration(&mut self, duration: Duration)
warning: this does not reset the timer
pub fn duration(&mut self) -> Duration
pub fn cancel(&mut self) -> bool
pub fn reset(&mut self) -> bool
Trait Implementations§
source§impl Clone for TimeoutContainer
impl Clone for TimeoutContainer
source§fn clone(&self) -> TimeoutContainer
fn clone(&self) -> TimeoutContainer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more