Struct gcrypt::Error
[−]
pub struct Error { /* fields omitted */ }
A type wrapping errors produced by GPG libraries.
Methods
impl Error
fn new(err: u32) -> Error
Creates a new error from a raw error value.
fn raw(&self) -> u32
Returns the raw error value that this error wraps.
fn from_source(source: u32, code: u32) -> Error
Creates a new error from an error source and an error code.
fn from_code(code: u32) -> 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) -> u32
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 PartialEq<Error> for Error
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 From<NulError> for Error
impl From<Error> for Error
impl Display for Error
impl Eq for Error
impl Copy for Error
impl Debug for Error
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl Hash for Error
fn hash<__H>(&self, __arg_0: &mut __H) where __H: Hasher
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl Clone for Error
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