With this trait the impl_cast macros are no longer needed, simplifying everything. This commit also improved how the actual casting itself is handled.
11 lines
252 B
Rust
11 lines
252 B
Rust
use std::time::Duration;
|
|
|
|
use anyhow::Result;
|
|
use async_trait::async_trait;
|
|
|
|
#[async_trait]
|
|
pub trait Timeout: Sync + Send {
|
|
async fn start_timeout(&mut self, _timeout: Duration) -> Result<()>;
|
|
async fn stop_timeout(&mut self) -> Result<()>;
|
|
}
|