aboutsummaryrefslogtreecommitdiff
path: root/src/format/mod.rs
diff options
context:
space:
mode:
authorTill Höppner2016-02-04 15:05:12 +0100
committerTill Höppner2016-02-04 15:05:12 +0100
commit815f31f5cef61709c50087c9f7601ea330929bb7 (patch)
tree07516a4d0528819b1de80958f55862bac4f24964 /src/format/mod.rs
parent75b6c893acf9df6c3cecc8528f3c17e110378336 (diff)
downloadilc-815f31f5cef61709c50087c9f7601ea330929bb7.tar.gz
ilc-815f31f5cef61709c50087c9f7601ea330929bb7.tar.xz
ilc-815f31f5cef61709c50087c9f7601ea330929bb7.zip
Rename weechat3 -> weechat
Diffstat (limited to 'src/format/mod.rs')
-rw-r--r--src/format/mod.rs29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/format/mod.rs b/src/format/mod.rs
index f7de677..cea6855 100644
--- a/src/format/mod.rs
+++ b/src/format/mod.rs
@@ -23,11 +23,16 @@ use std::borrow::Cow;
use event::Event;
use context::Context;
-pub mod energymech;
-pub mod weechat3;
+pub use self::energymech::Energymech;
+pub use self::weechat::Weechat;
+pub use self::binary::Binary;
+pub use self::msgpack::Msgpack;
+
+mod energymech;
+mod weechat;
// pub mod irssi;
-pub mod binary;
-pub mod msgpack;
+mod binary;
+mod msgpack;
pub trait Encode {
fn encode<'a>(&'a self, context: &'a Context, output: &'a mut Write, event: &'a Event) -> ::Result<()>;
@@ -47,22 +52,22 @@ impl Decode for Dummy {
pub fn decoder(format: &str) -> Option<Box<Decode>> {
match format {
- "energymech" | "em" => Some(Box::new(energymech::Energymech)),
- "weechat3" | "weechat" | "w3" => Some(Box::new(weechat3::Weechat3)),
+ "energymech" | "em" => Some(Box::new(Energymech)),
+ "weechat" | "w" => Some(Box::new(Weechat)),
// "irssi" => Some(Box::new(irssi::Irssi)),
- "binary" => Some(Box::new(binary::Binary)),
- "msgpack" => Some(Box::new(msgpack::Msgpack)),
+ "binary" => Some(Box::new(Binary)),
+ "msgpack" => Some(Box::new(Msgpack)),
_ => None
}
}
pub fn encoder(format: &str) -> Option<Box<Encode>> {
match format {
- "energymech" | "em" => Some(Box::new(energymech::Energymech)),
- "weechat3" | "weechat" | "w3" => Some(Box::new(weechat3::Weechat3)),
+ "energymech" | "em" => Some(Box::new(Energymech)),
+ "weechat" | "w" => Some(Box::new(Weechat)),
// "irssi" => Some(Box::new(irssi::Irssi)),
- "binary" => Some(Box::new(binary::Binary)),
- "msgpack" => Some(Box::new(msgpack::Msgpack)),
+ "binary" => Some(Box::new(Binary)),
+ "msgpack" => Some(Box::new(Msgpack)),
_ => None
}
}