aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: d6afd380c029f9ac824573873987242cf4077fa9 (plain)
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
#![feature(plugin, slice_patterns, core, custom_derive)]
#![plugin(regex_macros)]
#![cfg_attr(feature = "lints", plugin(clippy))]
extern crate regex;
extern crate chrono;
#[macro_use]
extern crate log as l;
extern crate rustc_serialize;
extern crate bincode;

pub mod log;
pub mod format;

use std::convert::From;
use std::{ io, result };

use chrono::format::ParseError;

pub type Result<T> = result::Result<T, IlcError>;

#[derive(Debug)]
pub enum IlcError {
    Parse(String),
    Chrono(ParseError),
    BincodeDecode,
    BincodeEncode,
    Io(io::Error)
}

impl From<ParseError> for IlcError {
    fn from(err: ParseError) -> IlcError { IlcError::Chrono(err) }
}

impl From<io::Error> for IlcError {
    fn from(err: io::Error) -> IlcError { IlcError::Io(err) }
}