diff options
author | Till Hoeppner | 2015-03-23 16:41:44 +0100 |
---|---|---|
committer | Till Hoeppner | 2015-03-23 16:41:44 +0100 |
commit | d972eed6b596d415a0aa6117a05bd107dbb8a0ae (patch) | |
tree | 824b4d8bdb40f3b89c7ceb21e20114f76d6ed895 /src/lib.rs | |
download | ilc-d972eed6b596d415a0aa6117a05bd107dbb8a0ae.tar.gz ilc-d972eed6b596d415a0aa6117a05bd107dbb8a0ae.tar.xz ilc-d972eed6b596d415a0aa6117a05bd107dbb8a0ae.zip |
Initial commit.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..0e49d17 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,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) } +} |