Struct gpg_error::Error
[−]
[src]
pub struct Error { /* fields omitted */ }
A type wrapping errors produced by GPG libraries.
Methods
impl Error
[src]
fn new(err: gpg_error_t) -> Error
Creates a new error from a raw error value.
fn raw(&self) -> gpg_error_t
Returns the raw error value that this error wraps.
fn from_source(source: ErrorSource, code: ErrorCode) -> Error
Creates a new error from an error source and an error code.
fn from_code(code: ErrorCode) -> Error
Creates a new error from an error code using the default
error source GPG_ERR_SOURCE_USER_1
.
fn last_os_error() -> Error
Returns an error representing the last OS error that occurred.
fn from_errno(code: i32) -> Error
Creates a new error from an OS error code.
fn to_errno(&self) -> i32
Returns the OS error that this error represents.
fn code(&self) -> ErrorCode
Returns the error code.
fn source(&self) -> Option<&'static str>
Returns a description of the source of the error as a UTF-8 string.
fn raw_source(&self) -> Option<&'static [u8]>
Returns a description of the source of the error as a slice of bytes.
fn description(&self) -> Cow<'static, str>
Returns a printable description of the error.
fn raw_description(&self) -> Cow<'static, [u8]>
Returns a description of the error as a slice of bytes.
Trait Implementations
impl Copy for Error
[src]
impl Clone for Error
[src]
fn clone(&self) -> Error
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Eq for Error
[src]
impl PartialEq for Error
[src]
fn eq(&self, __arg_0: &Error) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Error) -> bool
This method tests for !=
.
impl Hash for Error
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Error for Error
[src]
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
1.0.0
The lower-level cause of this error, if any. Read more