sea_streamer_runtime/timeout/no_rt_timeout.rs
1use std::{future::Future, time::Duration};
2
3#[derive(Debug)]
4pub struct TimeoutError;
5
6pub async fn timeout<F, T>(_: Duration, _f: F) -> Result<T, TimeoutError>
7where
8 F: Future<Output = T>,
9{
10 Err(TimeoutError)
11}
12
13impl std::fmt::Display for TimeoutError {
14 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15 write!(f, "Please enable a runtime")
16 }
17}
18
19impl std::error::Error for TimeoutError {}