pub struct Error { /* private fields */ }Expand description
A detailed error reported as part of an ErrorStack.
Implementations§
Source§impl Error
impl Error
Sourcepub fn get() -> Option<Error>
pub fn get() -> Option<Error>
Pops the first error off the OpenSSL error stack.
This corresponds to ERR_get_error_line_data.
Sourcepub fn put(&self)
pub fn put(&self)
Pushes the error back onto the OpenSSL error stack.
This corresponds to ERR_put_error.
Sourcepub fn library_reason(&self, library_code: ErrLib) -> Option<c_int>
pub fn library_reason(&self, library_code: ErrLib) -> Option<c_int>
Get {lib}_R_{reason} reason code for the given library, or None if the error is from a different library.
Libraries are identified by [ERR_LIB_{name}(ffi::ERR_LIB_SSL) constants.
Sourcepub fn code(&self) -> c_uint
👎Deprecated: use library_reason() to compare error codes
pub fn code(&self) -> c_uint
Returns a raw OpenSSL packed error code for this error, which can’t be reliably compared to any error constant.
Use Error::library_code() and Error::library_reason() instead.
Packed error codes are different than SSL error codes.
Sourcepub fn library(&self) -> Option<&'static str>
pub fn library(&self) -> Option<&'static str>
Returns the name of the library reporting the error, if available.
Sourcepub fn library_code(&self) -> c_int
pub fn library_code(&self) -> c_int
Returns the raw OpenSSL error constant for the library reporting the error (ERR_LIB_{name}).
Error reason codes are not globally unique, but scoped to each library.
Sourcepub fn function(&self) -> Option<&'static str>
pub fn function(&self) -> Option<&'static str>
Returns None. Boring doesn’t use function codes.
Sourcepub fn reason_code(&self) -> c_int
pub fn reason_code(&self) -> c_int
Returns library-specific reason code corresponding to some of the {lib}_R_{reason} constants.
Reason codes are ambiguous, and different libraries reuse the same numeric values for different errors.
Use Error::library_reason to compare error codes.
For ERR_LIB_SYS the reason code is errno. ERR_LIB_USER can use any values.
Other libraries may use ERR_R_* or their own codes.
Sourcepub fn file(&self) -> &'static str
pub fn file(&self) -> &'static str
Returns the name of the source file which encountered the error.