aboutsummaryrefslogtreecommitdiff
path: root/error.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2013-11-09 23:06:45 -0800
committerSteven Fackler <[email protected]>2013-11-09 23:06:45 -0800
commit59c05483dabeec084b5d358f88daea10c0f6273a (patch)
tree586c6439382cb5008d422b9908104fa224453b26 /error.rs
parentHave traivs actually test (diff)
downloadrust-openssl-59c05483dabeec084b5d358f88daea10c0f6273a.tar.xz
rust-openssl-59c05483dabeec084b5d358f88daea10c0f6273a.zip
Some documentation
Diffstat (limited to 'error.rs')
-rw-r--r--error.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/error.rs b/error.rs
index d009b38c..769cc768 100644
--- a/error.rs
+++ b/error.rs
@@ -2,18 +2,27 @@ use std::libc::c_ulong;
use super::ffi;
+/// An SSL error
#[deriving(ToStr)]
pub enum SslError {
+ /// The underlying stream has reported an EOF
StreamEof,
+ /// The SSL session has been closed by the other end
SslSessionClosed,
+ /// An error in the OpenSSL library
OpenSslErrors(~[OpensslError])
}
+/// An error from the OpenSSL library
#[deriving(ToStr)]
pub enum OpensslError {
+ /// An unknown error
UnknownError {
+ /// The library reporting the error
library: u8,
+ /// The function reporting the error
function: u16,
+ /// The reason for the error
reason: u16
}
}
@@ -31,6 +40,8 @@ fn get_reason(err: c_ulong) -> u16 {
}
impl SslError {
+ /// Creates a new `OpenSslErrors` with the current contents of the error
+ /// stack.
pub fn get() -> SslError {
let mut errs = ~[];
loop {