aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: 0e49d1793656498240299b9fdebc8f50afce59c0 (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
#![feature(plugin)]
#![plugin(regex_macros)]
extern crate regex;
extern crate chrono;

pub mod log;
pub mod format;

use std::error::FromError;
use std::{ io, result };

use chrono::format::ParseError;

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

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

impl FromError<ParseError> for IlcError {
    fn from_error(err: ParseError) -> IlcError { IlcError::Chrono(err) }
}

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