kithara_platform/common/time.rs
1pub use core::time::Duration;
2
3pub use web_time::{Instant, SystemTime};
4
5/// Error returned when an async operation exceeds its deadline.
6#[derive(Debug)]
7pub struct TimeoutError;
8
9impl std::fmt::Display for TimeoutError {
10 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11 f.write_str("operation timed out")
12 }
13}
14
15impl std::error::Error for TimeoutError {}