Loading src/lib.rs +1 −1 Original line number Diff line number Diff line #![feature(struct_variant, macro_rules, unsafe_destructor)] #![feature(struct_variant, macro_rules, unsafe_destructor, globs)] #![crate_name="openssl"] #![crate_type="rlib"] #![crate_type="dylib"] Loading src/ssl/error.rs +22 −1 Original line number Diff line number Diff line pub use self::SslError::*; pub use self::OpensslError::*; use libc::c_ulong; use std::error; use std::io::IoError; use std::c_str::CString; Loading @@ -7,7 +11,7 @@ use ffi; /// An SSL error #[deriving(Show, Clone, PartialEq, Eq)] pub enum SslError { /// The underlying stream has reported an error /// The underlying stream reported an error StreamError(IoError), /// The SSL session has been closed by the other end SslSessionClosed, Loading @@ -15,6 +19,23 @@ pub enum SslError { OpenSslErrors(Vec<OpensslError>) } impl error::Error for SslError { fn description(&self) -> &str { match *self { StreamError(_) => "The underlying stream reported an error", SslSessionClosed => "The SSL session has been closed by the other end", OpenSslErrors(_) => "An error in the OpenSSL library", } } fn cause(&self) -> Option<&error::Error> { match *self { StreamError(ref err) => Some(err as &error::Error), _ => None } } } /// An error from the OpenSSL library #[deriving(Show, Clone, PartialEq, Eq)] pub enum OpensslError { Loading Loading
src/lib.rs +1 −1 Original line number Diff line number Diff line #![feature(struct_variant, macro_rules, unsafe_destructor)] #![feature(struct_variant, macro_rules, unsafe_destructor, globs)] #![crate_name="openssl"] #![crate_type="rlib"] #![crate_type="dylib"] Loading
src/ssl/error.rs +22 −1 Original line number Diff line number Diff line pub use self::SslError::*; pub use self::OpensslError::*; use libc::c_ulong; use std::error; use std::io::IoError; use std::c_str::CString; Loading @@ -7,7 +11,7 @@ use ffi; /// An SSL error #[deriving(Show, Clone, PartialEq, Eq)] pub enum SslError { /// The underlying stream has reported an error /// The underlying stream reported an error StreamError(IoError), /// The SSL session has been closed by the other end SslSessionClosed, Loading @@ -15,6 +19,23 @@ pub enum SslError { OpenSslErrors(Vec<OpensslError>) } impl error::Error for SslError { fn description(&self) -> &str { match *self { StreamError(_) => "The underlying stream reported an error", SslSessionClosed => "The SSL session has been closed by the other end", OpenSslErrors(_) => "An error in the OpenSSL library", } } fn cause(&self) -> Option<&error::Error> { match *self { StreamError(ref err) => Some(err as &error::Error), _ => None } } } /// An error from the OpenSSL library #[deriving(Show, Clone, PartialEq, Eq)] pub enum OpensslError { Loading