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
extern crate chrono;
extern crate crypto_currency as currency;
extern crate crypto_market as market;
extern crate crypto_market_event as event;
extern crate crypto_market_stream as stream;
extern crate crypto_util as util;
extern crate futures;
#[macro_use]
extern crate log;
extern crate serde_json;
extern crate tokio_core;
extern crate websocket;
mod connect;
pub mod errors;
mod handle;
mod msg;
pub use self::connect::connect;
pub use self::handle::Handle;
pub use self::msg::Message;
use market::Market;
use stream::Command;
pub trait Protocol {
type Error: ::std::error::Error;
fn address() -> &'static str;
fn market() -> Market;
fn parse(msg: &str) -> Result<Option<Message>, Self::Error>;
fn serialize(cmd: Command) -> String;
}