sea_streamer_runtime/task/
no_rt_task.rs1use futures::future::{ready, Ready};
2use std::future::Future;
3
4#[derive(Debug)]
5pub struct JoinError;
6
7pub type TaskHandle<T> = Ready<Result<T, JoinError>>;
8
9pub fn spawn_task<F, T>(_: F) -> TaskHandle<T>
10where
11 F: Future<Output = T> + Send + 'static,
12 T: Send + 'static,
13{
14 ready(Err(JoinError))
15}
16
17pub fn spawn_blocking<F, T>(_: F) -> TaskHandle<T>
18where
19 F: FnOnce() -> T + Send + 'static,
20 T: Send + 'static,
21{
22 ready(Err(JoinError))
23}
24
25impl std::fmt::Display for JoinError {
26 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27 write!(f, "Please enable a runtime")
28 }
29}
30
31impl std::error::Error for JoinError {}