pub enum TimerExpMode<TIMERTYPE: ModeTimeType> {
None,
OneShot {
timeout: TIMERTYPE,
},
IntervalDelayed {
delay_tm: TIMERTYPE,
interv_tm: TIMERTYPE,
},
Interval {
interv_tm: TIMERTYPE,
},
}
Expand description
A timer expiry modes. Not every OS supports
every mode. Read comments for the OS specific
timer. For the nanoseconds
param the max value
is 999_999_999 for most OSes.
Variants§
None
Disarmed
OneShot
A timer which is triggered once.
Fields
timeout: TIMERTYPE
IntervalDelayed
Interval with the initial delay.
Interval
Interval, with the first timeout event equal to interval values.
Fields
interv_tm: TIMERTYPE
Interval seconds.
Implementations§
Source§impl TimerExpMode<AbsoluteTime>
Implementations of the TimerExpMode for AbsoluteTime.
impl TimerExpMode<AbsoluteTime>
Implementations of the TimerExpMode for AbsoluteTime.
Sourcepub fn new_oneshot(abs_time: AbsoluteTime) -> Self
pub fn new_oneshot(abs_time: AbsoluteTime) -> Self
Construct the TimerExpMode::OneShot timer. For the absolute
timer
only this type is available. The AbsoluteTime should be provided which
should be ahead of the OS’es timer.
Source§impl TimerExpMode<RelativeTime>
Implementations of the TimerExpMode for RelativeTime.
impl TimerExpMode<RelativeTime>
Implementations of the TimerExpMode for RelativeTime.
Sourcepub fn new_oneshot(rel_time: RelativeTime) -> Self
pub fn new_oneshot(rel_time: RelativeTime) -> Self
Construct the TimerExpMode::OneShot timer. A RelativeTime should be provided as argument. This type of timer is triggered only once.
Sourcepub fn new_interval(rel_time: RelativeTime) -> Self
pub fn new_interval(rel_time: RelativeTime) -> Self
Constrcut the TimerExpMode::Interval timer. A RelativeTime should be provided as agument which specifies the trigger interval.
Sourcepub fn new_interval_with_init_delay(
delay_time: RelativeTime,
intev_time: RelativeTime,
) -> Self
pub fn new_interval_with_init_delay( delay_time: RelativeTime, intev_time: RelativeTime, ) -> Self
Construct the TimerExpMode::IntervalDelayed timer. A two RelativeTime
arguments should be provided which would set the initial delay and further
interval. The initial delay happens only once. Then the interval will be used.
If delay_time
and intev_time
are same, acts as new_interval
.
Source§impl<TIMERTYPE: ModeTimeType> TimerExpMode<TIMERTYPE>
impl<TIMERTYPE: ModeTimeType> TimerExpMode<TIMERTYPE>
Trait Implementations§
Source§impl Add<RelativeTime> for TimerExpMode<AbsoluteTime>
impl Add<RelativeTime> for TimerExpMode<AbsoluteTime>
Source§type Output = TimerExpMode<AbsoluteTime>
type Output = TimerExpMode<AbsoluteTime>
+
operator.Source§impl AddAssign<RelativeTime> for TimerExpMode<AbsoluteTime>
impl AddAssign<RelativeTime> for TimerExpMode<AbsoluteTime>
Source§fn add_assign(&mut self, rhs: RelativeTime)
fn add_assign(&mut self, rhs: RelativeTime)
+=
operation. Read moreSource§impl<TIMERTYPE: Clone + ModeTimeType> Clone for TimerExpMode<TIMERTYPE>
impl<TIMERTYPE: Clone + ModeTimeType> Clone for TimerExpMode<TIMERTYPE>
Source§fn clone(&self) -> TimerExpMode<TIMERTYPE>
fn clone(&self) -> TimerExpMode<TIMERTYPE>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<TIMERTYPE: Debug + ModeTimeType> Debug for TimerExpMode<TIMERTYPE>
impl<TIMERTYPE: Debug + ModeTimeType> Debug for TimerExpMode<TIMERTYPE>
Source§impl<TIMERTYPE: ModeTimeType> Display for TimerExpMode<TIMERTYPE>
impl<TIMERTYPE: ModeTimeType> Display for TimerExpMode<TIMERTYPE>
Source§impl<TIMERTYPE: ModeTimeType> From<&TimerExpMode<TIMERTYPE>> for itimerspec
Converts from the reference to TimerExpMode of the TIMERTYPE
into the
itimerspec.
impl<TIMERTYPE: ModeTimeType> From<&TimerExpMode<TIMERTYPE>> for itimerspec
Converts from the reference to TimerExpMode of the TIMERTYPE
into the
itimerspec.
Source§fn from(value: &TimerExpMode<TIMERTYPE>) -> Self
fn from(value: &TimerExpMode<TIMERTYPE>) -> Self
Source§impl From<TimerExpMode<AbsoluteTime>> for PeriodicTaskTime
impl From<TimerExpMode<AbsoluteTime>> for PeriodicTaskTime
Source§fn from(value: TimerExpMode<AbsoluteTime>) -> Self
fn from(value: TimerExpMode<AbsoluteTime>) -> Self
Source§impl From<TimerExpMode<RelativeTime>> for PeriodicTaskTime
impl From<TimerExpMode<RelativeTime>> for PeriodicTaskTime
Source§fn from(value: TimerExpMode<RelativeTime>) -> Self
fn from(value: TimerExpMode<RelativeTime>) -> Self
Source§impl<TIMERTYPE: ModeTimeType> From<TimerExpMode<TIMERTYPE>> for itimerspec
impl<TIMERTYPE: ModeTimeType> From<TimerExpMode<TIMERTYPE>> for itimerspec
Source§fn from(value: TimerExpMode<TIMERTYPE>) -> Self
fn from(value: TimerExpMode<TIMERTYPE>) -> Self
Source§impl<TIMERTYPE: ModeTimeType> From<itimerspec> for TimerExpMode<TIMERTYPE>
Converts from itimerspec into TimerExpMode of the TIMERTYPE
.
impl<TIMERTYPE: ModeTimeType> From<itimerspec> for TimerExpMode<TIMERTYPE>
Converts from itimerspec into TimerExpMode of the TIMERTYPE
.