pub struct TimerConfig {
pub delay: Duration,
pub interval: Option<Duration>,
pub priority: Priority,
}Expand description
Timer configuration.
Specifies when a timer should fire and at what priority the callback
should execute. This struct is provided for advanced use cases where
you need more control than Runtime::schedule_delayed() provides.
§Example
use reovim_kernel::api::v1::*;
use std::time::Duration;
// One-shot timer after 100ms
let config = TimerConfig {
delay: Duration::from_millis(100),
interval: None,
priority: Priority::NORMAL,
};
// Periodic timer every 50ms
let periodic = TimerConfig {
delay: Duration::from_millis(50),
interval: Some(Duration::from_millis(50)),
priority: Priority::LOW,
};Fields§
§delay: DurationInitial delay before first execution.
interval: Option<Duration>Optional interval for periodic timers.
If Some, the timer will reschedule after each execution.
If None, the timer is one-shot and removed after firing.
priority: PriorityPriority for the scheduled task.
Determines execution order relative to other work in the queue.
Trait Implementations§
Source§impl Clone for TimerConfig
impl Clone for TimerConfig
Source§fn clone(&self) -> TimerConfig
fn clone(&self) -> TimerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TimerConfig
impl Debug for TimerConfig
Auto Trait Implementations§
impl Freeze for TimerConfig
impl RefUnwindSafe for TimerConfig
impl Send for TimerConfig
impl Sync for TimerConfig
impl Unpin for TimerConfig
impl UnsafeUnpin for TimerConfig
impl UnwindSafe for TimerConfig
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