pub struct CmdTimer {
pub time: Duration,
pub activation: Option<Command>,
pub abortion: Option<Command>,
pub deactivation: Option<Command>,
pub disabled: bool,
pub activation_child: Option<Child>,
}Expand description
A simple timer that runs a binary executable after a certain amount of time
Fields§
§time: DurationThe idle time required for this timer to activate
activation: Option<Command>The command, if any, to run upon activation
abortion: Option<Command>The command, if any, to run upon abortion
deactivation: Option<Command>The command, if any, to run upon deactivation
disabled: boolWhether or not to disable this timer
activation_child: Option<Child>The child process that is currently running
Trait Implementations§
Source§impl Timer for CmdTimer
impl Timer for CmdTimer
Source§fn time_left(&mut self, idle_time: Duration) -> Result<Option<Duration>>
fn time_left(&mut self, idle_time: Duration) -> Result<Option<Duration>>
Return the time left based on the relative idle time
Source§fn abort_urgency(&self) -> Option<Duration>
fn abort_urgency(&self) -> Option<Duration>
How urgent this timer wants to be notified on abort (when the user is no longer idle).
Return as slow of a duration as you think is acceptable to be nice to the CPU - preferrably
return
None which basically means infinity.Source§fn abort(&mut self) -> Result<()>
fn abort(&mut self) -> Result<()>
Called when the timer was aborted early - such as when the
user moves their mouse or otherwise stops being idle.
Source§fn deactivate(&mut self) -> Result<()>
fn deactivate(&mut self) -> Result<()>
Called when another timer was activated after this one
Auto Trait Implementations§
impl Freeze for CmdTimer
impl !RefUnwindSafe for CmdTimer
impl Send for CmdTimer
impl Sync for CmdTimer
impl Unpin for CmdTimer
impl !UnwindSafe for CmdTimer
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