pub trait FdTimerCom {
// Required methods
fn new(
label: Cow<'static, str>,
timer_type: TimerType,
timer_flags: TimerFlags,
) -> TimerPortResult<Self>
where Self: Sized;
fn read(&self) -> TimerPortResult<TimerReadRes<u64>>;
fn set_time<TIMERTYPE: ModeTimeType>(
&self,
timer_exp: TimerExpMode<TIMERTYPE>,
) -> TimerPortResult<()>;
fn unset_time(&self) -> TimerPortResult<()>;
}
Expand description
A common trait which is implemented by all timer realizationss for different OSes.
Required Methods§
Sourcefn new(
label: Cow<'static, str>,
timer_type: TimerType,
timer_flags: TimerFlags,
) -> TimerPortResult<Self>where
Self: Sized,
fn new(
label: Cow<'static, str>,
timer_type: TimerType,
timer_flags: TimerFlags,
) -> TimerPortResult<Self>where
Self: Sized,
Sourcefn read(&self) -> TimerPortResult<TimerReadRes<u64>>
fn read(&self) -> TimerPortResult<TimerReadRes<u64>>
Attempts to read the timer. The realization is different on different OS. The main purpose is to check if timer is ready (ended).
Sourcefn set_time<TIMERTYPE: ModeTimeType>(
&self,
timer_exp: TimerExpMode<TIMERTYPE>,
) -> TimerPortResult<()>
fn set_time<TIMERTYPE: ModeTimeType>( &self, timer_exp: TimerExpMode<TIMERTYPE>, ) -> TimerPortResult<()>
Sets the timer. The timer starts immidiatly and working depending on the timer_exp
mode.
In case of timer does not support TimerExpMode::IntervalDelayed nativly (on OS level), the
crate will store the interval
part and set interval on first read()
i.e after the delay
and remove the stored interval
(or may not) from the inner field.
Sourcefn unset_time(&self) -> TimerPortResult<()>
fn unset_time(&self) -> TimerPortResult<()>
Unsets the timer. The timer stops immidiatly.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.