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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use std::io;
use futures::{Stream, Sink, Async};
use tokio_core::io::{Io, Framed, Codec};
mod frame_buf;
mod client;
pub use self::client::ClientProto;
mod server;
pub use self::server::ServerProto;
mod frame;
pub use self::frame::Frame;
pub mod advanced;
pub type RequestId = u64;
pub struct StreamingMultiplex<B>(B);
pub trait Transport<ReadBody>: 'static +
Stream<Error = io::Error> +
Sink<SinkError = io::Error>
{
fn tick(&mut self) {}
fn cancel(&mut self, request_id: RequestId) -> io::Result<()> {
drop(request_id);
Ok(())
}
fn poll_write_body(&mut self, id: RequestId) -> Async<()> {
drop(id);
Async::Ready(())
}
fn dispatching_body(&mut self, id: RequestId, body: &ReadBody) {
drop(id);
drop(body);
}
}
impl<T:Io + 'static, C: Codec + 'static, ReadBody> Transport<ReadBody> for Framed<T,C> {}