From e1d4270acbb12306f5e30927b4f05ff2ff6c6937 Mon Sep 17 00:00:00 2001 From: Till Hoeppner Date: Mon, 4 May 2015 20:09:59 +0200 Subject: Add SSL connections and use them in the example --- src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index a4da317..6ec60db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,8 @@ extern crate regex; #[macro_use] extern crate log; +#[cfg(feature = "ssl")] +extern crate openssl; pub mod client; pub mod color; @@ -19,6 +21,9 @@ pub mod reply; use std::io; use std::result; +#[cfg(feature = "ssl")] +use openssl::ssl::error::SslError; + pub use ident::Ident; pub use message::{ Message, MsgType }; pub use command::Command; @@ -29,7 +34,14 @@ pub enum IrscError { Io(io::Error), AlreadyConnected, NotConnected, - NotFound + NotFound, + #[cfg(feature = "ssl")] + Ssl(SslError) +} + +#[cfg(feature = "ssl")] +impl From for IrscError { + fn from(e: SslError) -> IrscError { IrscError::Ssl(e) } } pub type Result = result::Result; -- cgit v1.2.3