pub struct DequePeriodic { /* private fields */ }Expand description
This queue mode does not remove an element that has timed out (by absolute_timeout),
but extends (by relative_period) the timeout and returns the element back to the queue.
Implementations§
Source§impl DequePeriodic
impl DequePeriodic
Sourcepub fn new_from_now(rel_time: impl Into<RelativeTime>) -> Self
pub fn new_from_now(rel_time: impl Into<RelativeTime>) -> Self
Creates new instance. The relative_time is not added to
absolute_time until timeout. The values are unchecked at this
point and will be checked during placement in queue.
Sourcepub fn new(
abs_time: impl Into<AbsoluteTime>,
rel_time: impl Into<RelativeTime>,
) -> Self
pub fn new( abs_time: impl Into<AbsoluteTime>, rel_time: impl Into<RelativeTime>, ) -> Self
Creates new instance with the initial timeout abs_time and
period rel_time which is added to the abs_time each time
the timeout occures. The values are unchecked at this
point and will be checked during placement in queue.
Trait Implementations§
Source§impl Clone for DequePeriodic
impl Clone for DequePeriodic
Source§fn clone(&self) -> DequePeriodic
fn clone(&self) -> DequePeriodic
Returns a duplicate 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 moreSource§impl Debug for DequePeriodic
impl Debug for DequePeriodic
Source§impl Display for DequePeriodic
impl Display for DequePeriodic
Source§impl Ord for DequePeriodic
impl Ord for DequePeriodic
Source§impl OrderedTimerDequeMode for DequePeriodic
impl OrderedTimerDequeMode for DequePeriodic
Source§const IS_ONCE: bool = false
const IS_ONCE: bool = false
A type of operation. If the item deques once, then this value should be
true. Otherwise, it is periodic.Source§fn get_absolut_timeout(&self) -> AbsoluteTime
fn get_absolut_timeout(&self) -> AbsoluteTime
Returns the
absolute timeout for the instance of the deque.Source§fn advance_timeout(&mut self)
fn advance_timeout(&mut self)
Updates the timeout when the deque works in periodic mode. By fedault
it does nothing.
Source§fn validate_time(&self, cmp: AbsoluteTime) -> TimerResult<()>
fn validate_time(&self, cmp: AbsoluteTime) -> TimerResult<()>
Checks the current instance against the provided
cmp AbsoluteTime.
It is expected that the current instance’s timeout value is actual and
haven’t outlive the cmp already. if it does the error:
TimerErrorType::Expired should be returned. Or any other error
if it is required.Source§fn postpone(&mut self, posp_time: RelativeTime) -> TimerResult<()>
fn postpone(&mut self, posp_time: RelativeTime) -> TimerResult<()>
Postpones the time by the relative offset
post_time. May return error
(if required) if the absolut timeout value overflows. Read moreSource§impl PartialEq for DequePeriodic
impl PartialEq for DequePeriodic
Source§impl PartialOrd for DequePeriodic
impl PartialOrd for DequePeriodic
impl Copy for DequePeriodic
impl Eq for DequePeriodic
Auto Trait Implementations§
impl Freeze for DequePeriodic
impl RefUnwindSafe for DequePeriodic
impl Send for DequePeriodic
impl Sync for DequePeriodic
impl Unpin for DequePeriodic
impl UnwindSafe for DequePeriodic
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