aboutsummaryrefslogtreecommitdiff
path: root/base/src/lib.rs
blob: a9349cc3c4a35d875e0614d69d61d2a0c96f864e (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
extern crate chrono;
#[macro_use]
extern crate log;
extern crate rustc_serialize;

pub mod event;
pub mod context;
pub mod error;
pub mod format;
pub mod dummy;

use std::io::{BufRead, Write};

pub use context::Context;
pub use event::{Event, Time};
pub use error::*;

pub trait Encode {
    fn encode<'a>(&'a self,
                  context: &'a Context,
                  output: &'a mut Write,
                  event: &'a Event)
                  -> error::Result<()>;
}

pub trait Decode {
    fn decode<'a>(&'a self,
                  context: &'a Context,
                  input: &'a mut BufRead)
                  -> Box<Iterator<Item = error::Result<Event<'a>>> + 'a>;
}