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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#![feature(test, try_trait)]
#[macro_use]
extern crate log;
#[macro_use]
extern crate failure;
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate serde_derive;
extern crate byteorder;
extern crate rayon;
extern crate serde;
extern crate cxmr_balances;
extern crate cxmr_exchanges;
extern crate cxmr_feeds;
extern crate glob;
#[macro_use]
extern crate err_convert_macro;
mod codec;
mod dirs;
mod meta;
pub mod dtf;
pub mod sync;
pub use self::codec::*;
pub use self::dirs::*;
pub use self::dtf::{create_dtf, read_dtf};
pub use self::meta::*;
pub use self::sync::TectonicClient;
#[derive(Debug, Fail)]
pub enum Error {
#[fail(display = "option none")]
OptionNone,
#[fail(display = "time range is invalid")]
InvalidTimeRange,
#[fail(display = "input is invalid: {}", _0)]
InvalidInput(String),
#[fail(display = "IO error: {}", _0)]
Io(#[cause] std::io::Error),
#[fail(display = "currency module error: {}", _0)]
Currency(#[cause] cxmr_currency::Error),
#[fail(display = "exchange module error: {}", _0)]
Exchange(#[cause] cxmr_exchanges::Error),
#[fail(display = "tectonic connection error")]
ConnectionError,
#[fail(display = "database not found: {}", _0)]
DatabaseNotFound(String),
#[fail(display = "server error: {}", _0)]
ServerError(String),
}
err_converter_no_args!(OptionNone, std::option::NoneError);
err_converter!(Io, std::io::Error);
err_converter!(Exchange, cxmr_exchanges::Error);
err_converter!(Currency, cxmr_currency::Error);
impl From<std::io::ErrorKind> for Error {
fn from(k: std::io::ErrorKind) -> Error {
Error::Io(k.into())
}
}