1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
mod websocket;
use std::future::Future;
use arpy::FnRemote;
pub use websocket::{WebSocketHandler, WebSocketRouter};
pub trait FnRemoteBody<Args>
where
Args: FnRemote,
{
type Fut: Future<Output = Args::Output> + Send + Sync;
fn run(&self, args: Args) -> Self::Fut;
}
impl<Args, Fut, F> FnRemoteBody<Args> for F
where
Args: FnRemote,
F: Fn(Args) -> Fut,
Fut: Future<Output = Args::Output> + Send + Sync,
{
type Fut = Fut;
fn run(&self, args: Args) -> Self::Fut {
self(args)
}
}