pub struct TimerBuilder<'a> { /* private fields */ }
Expand description
WinAPI timer builder
The same timer can act as one-shot timer and/or interval timer.
§Configuration
When single
method is called timer is configured as one-shot.
When interval
method is called timer is configured as interval.
When both of the above are called timer is configured as one-shot, after which it starts to run in interval.
By default timer starts as one-shot with timeout 0.
Implementations§
Source§impl<'a> TimerBuilder<'a>
impl<'a> TimerBuilder<'a>
Sourcepub fn raw_callback(self, cb: CallbackType, param: Option<*mut c_void>) -> Self
pub fn raw_callback(self, cb: CallbackType, param: Option<*mut c_void>) -> Self
Sets raw C function as callback
Sourcepub fn rust_callback(self, cb: fn()) -> Self
pub fn rust_callback(self, cb: fn()) -> Self
Sets Rust function pointer as callback
Sourcepub fn queue(self, queue: &'a TimerQueue) -> Self
pub fn queue(self, queue: &'a TimerQueue) -> Self
Sets timer queue.
If not set, default shall be used.
Sourcepub fn single(self, delay: c_ulong) -> Self
pub fn single(self, delay: c_ulong) -> Self
Makes timer to fire single time after delay in milliseconds.
Sourcepub fn interval(self, interval: c_ulong) -> Self
pub fn interval(self, interval: c_ulong) -> Self
Makes timer to fire with interval in milliseconds.
Sourcepub fn flags(self, flags: TimerFlags) -> Self
pub fn flags(self, flags: TimerFlags) -> Self
Specifies timer flags.
Default is raw::timer::DEFAULT_TIMER_FLAGS
.
Sourcepub fn build(self) -> Result<QueueTimer>
pub fn build(self) -> Result<QueueTimer>
Creates timer.
Auto Trait Implementations§
impl<'a> Freeze for TimerBuilder<'a>
impl<'a> RefUnwindSafe for TimerBuilder<'a>
impl<'a> !Send for TimerBuilder<'a>
impl<'a> !Sync for TimerBuilder<'a>
impl<'a> Unpin for TimerBuilder<'a>
impl<'a> UnwindSafe for TimerBuilder<'a>
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