Trait xidlehook_core::modules::Module[][src]

pub trait Module {
    fn pre_timer(&mut self, _timer: TimerInfo) -> Result<Progress> { ... }
fn post_timer(&mut self, _timer: TimerInfo) -> Result<Progress> { ... }
fn warning(&mut self, _error: &Error) -> Result<()> { ... }
fn reset(&mut self) -> Result<()> { ... } }

A generic module that controls whether timers should execute or not (outside of the normal timer)

Provided methods

fn pre_timer(&mut self, _timer: TimerInfo) -> Result<Progress>[src]

Decides if a timer should be allowed to execute

fn post_timer(&mut self, _timer: TimerInfo) -> Result<Progress>[src]

Decides what happens after a timer has executed

fn warning(&mut self, _error: &Error) -> Result<()>[src]

Is called when there’s a potentially recoverable error. Can re-throw an unrecoverable error.

fn reset(&mut self) -> Result<()>[src]

If this is called, the counting was reset - clear any cache here

Loading content...

Implementations on Foreign Types

impl Module for ()[src]

The default module is also the unit type because why not

impl Module for Box<dyn Module>[src]

impl<A, B> Module for (A, B) where
    A: Module,
    B: Module
[src]

Combine two timers using the type-system. Can be recursed for a fixed-size amount of timers. Similar to iterator.chain.

impl<M: Module> Module for Vec<M>[src]

Combine multiple modules with a dynamic size

Loading content...

Implementors

Loading content...