diff options
author | Till Hoeppner | 2015-05-04 20:09:59 +0200 |
---|---|---|
committer | Till Hoeppner | 2015-05-04 20:09:59 +0200 |
commit | e1d4270acbb12306f5e30927b4f05ff2ff6c6937 (patch) | |
tree | 364025d9a7b5378eee6b7cf37734cd35dec2f0d6 /src/lib.rs | |
parent | 4a092fd5ecccd1822c33702663701ad63953aa54 (diff) | |
download | irsc-e1d4270acbb12306f5e30927b4f05ff2ff6c6937.tar.gz irsc-e1d4270acbb12306f5e30927b4f05ff2ff6c6937.tar.xz irsc-e1d4270acbb12306f5e30927b4f05ff2ff6c6937.zip |
Add SSL connections and use them in the example
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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<SslError> for IrscError { + fn from(e: SslError) -> IrscError { IrscError::Ssl(e) } } pub type Result<T> = result::Result<T, IrscError>; |