diff options
author | Till Hoeppner | 2015-06-17 17:03:56 +0200 |
---|---|---|
committer | Till Hoeppner | 2015-06-17 17:04:06 +0200 |
commit | 2902d8734f5c1f036eb340e35e8d1dc7a74c23b6 (patch) | |
tree | d09ff702397a73c66c938b5891765e92e18abd69 /src/lib.rs | |
parent | 63838165c31397fec199bf99c96497a1169c4d52 (diff) | |
download | irsc-2902d8734f5c1f036eb340e35e8d1dc7a74c23b6.tar.gz irsc-2902d8734f5c1f036eb340e35e8d1dc7a74c23b6.tar.xz irsc-2902d8734f5c1f036eb340e35e8d1dc7a74c23b6.zip |
This commit is a little too large. Sorry. :S
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); |