zerolaunch_plugin_api/services/timer/
timer_manager.rs1use crate::host::error::HostApiError;
2use crate::services::timer::types::{TimerCallback, TimerId, TimerMode};
3use async_trait::async_trait;
4use std::time::Duration;
5
6#[async_trait]
10pub trait TimerManager: Send + Sync {
11 async fn set_timer(
20 &self,
21 delay: Duration,
22 mode: TimerMode,
23 callback: TimerCallback,
24 ) -> Result<TimerId, HostApiError>;
25
26 async fn cancel_timer(&self, id: TimerId) -> Result<(), HostApiError>;
31
32 async fn cancel_all(&self) -> Result<(), HostApiError>;
34}