aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index abcbc50..168f137 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,9 +18,11 @@ pub mod callback;
pub mod message;
pub mod command;
pub mod reply;
+pub mod event;
use std::io;
use std::result;
+use std::ops::{ Deref, DerefMut };
#[cfg(feature = "ssl")]
use openssl::ssl::error::SslError;
@@ -29,6 +31,7 @@ pub use ident::Ident;
pub use message::{ Message, MsgType };
pub use command::Command;
pub use reply::Reply;
+pub use event::Event;
pub use client::Client;
#[derive(Debug)]
@@ -46,6 +49,17 @@ impl From<SslError> for IrscError {
fn from(e: SslError) -> IrscError { IrscError::Ssl(e) }
}
-pub type Result<T> = result::Result<T, IrscError>;
+pub struct Result<T>(result::Result<T, IrscError>);
+
+impl<T> Deref for Result<T> {
+ type Target = result::Result<T, IrscError>;
+ fn deref(&self) -> &result::Result<T, IrscError> { &self.0 }
+}
+
+impl<T> DerefMut for Result<T> {
+ fn deref_mut(&mut self) -> &mut result::Result<T, IrscError> { &mut self.0 }
+}
+
+impl<T> Result<T> { fn inner(self) -> result::Result<T, IrscError> { self.0 } }
pub const DEBUG: bool = cfg!(debug_assertions);