Struct s2n_quic_core::time::timer::Timer
source · pub struct Timer { /* private fields */ }
Expand description
A timer that does not trigger an update in a timer list. These are usually owned by individual components and needs to be explicitly polled.
Note: The timer doesn’t implement Copy to ensure it isn’t accidentally moved and have the expiration discarded.
Implementations§
source§impl Timer
impl Timer
sourcepub fn cancel(&mut self)
pub fn cancel(&mut self)
Cancels the timer. After cancellation, a timer will no longer report as expired.
sourcepub fn is_expired(&self, current_time: Timestamp) -> bool
pub fn is_expired(&self, current_time: Timestamp) -> bool
Returns true if the timer has expired
sourcepub fn poll_expiration(&mut self, current_time: Timestamp) -> Poll<()>
pub fn poll_expiration(&mut self, current_time: Timestamp) -> Poll<()>
Notifies the timer of the current time. If the timer’s expiration occurs before the current time, it will be cancelled. The method returns whether the timer was expired and had been cancelled.
Trait Implementations§
source§impl PartialEq for Timer
impl PartialEq for Timer
source§impl Provider for Timer
impl Provider for Timer
source§fn timers<Q: Query>(&self, query: &mut Q) -> Result
fn timers<Q: Query>(&self, query: &mut Q) -> Result
Notifies the query of any timers owned by the provider Read more
source§fn next_expiration(&self) -> Option<Timestamp>
fn next_expiration(&self) -> Option<Timestamp>
Returns the next
Timestamp
at which the earliest timer is armed in the providersource§fn armed_timer_count(&self) -> usize
fn armed_timer_count(&self) -> usize
Counts the number of armed timers in the provider
impl Eq for Timer
impl StructuralPartialEq for Timer
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more