diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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); |