summaryrefslogtreecommitdiff
path: root/openssl/src/error.rs
diff options
context:
space:
mode:
authorAndy Gauge <andygauge@gmail.com>2017-10-27 16:59:36 -0700
committerAndy Gauge <andygauge@gmail.com>2017-10-27 16:59:36 -0700
commit556f37168978ef807034cca2c4338714431a6fe0 (patch)
treece1cec9d9a14697c46d7ec531b61e48968044e50 /openssl/src/error.rs
parent05ad00532c5aa08362edc929477eccbf98c16b86 (diff)
downloadrust-openssl-556f37168978ef807034cca2c4338714431a6fe0.zip
Error documentation improvement
Diffstat (limited to 'openssl/src/error.rs')
-rw-r--r--openssl/src/error.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/openssl/src/error.rs b/openssl/src/error.rs
index 9151c01b..e565c272 100644
--- a/openssl/src/error.rs
+++ b/openssl/src/error.rs
@@ -1,3 +1,20 @@
+//! Errors returned by OpenSSL library.
+//!
+//! OpenSSL errors are stored in an `ErrorStack`. Most methods in the crate
+/// returns a `Result<T, ErrorStack>` type.
+//!
+//! # Examples
+//!
+//! ```
+//! use openssl::error::ErrorStack;
+//! use openssl::bn::BigNum;
+//!
+//! let an_error = BigNum::from_dec_str("Cannot parse letters");
+//! match an_error {
+//! Ok(_) => _,
+//! Err(e) => println!("Parsing Error: {:?}", e),
+//! }
+//! ```
use libc::{c_ulong, c_char, c_int};
use std::fmt;
use std::error;
@@ -9,6 +26,9 @@ use std::borrow::Cow;
use ffi;
+/// Collection of [`Error`]s from OpenSSL.
+///
+/// [`Error`]: struct.Error.html
#[derive(Debug, Clone)]
pub struct ErrorStack(Vec<Error>);