Struct gpg_error::Error [] [src]

pub struct Error {
    // some fields omitted
}

A type wrapping errors produced by GPG libraries.

Methods

impl Error

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 Error for Error

fn description(&self) -> &str

1.0.0fn cause(&self) -> Option<&Error>

impl Display for Error

fn fmt(&self, fmt: &mut Formatter) -> Result

impl From<NulError> for Error

fn from(_: NulError) -> Error

impl From<Error> for Error

fn from(err: Error) -> Error

Derived Implementations

impl Hash for Error

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

1.3.0fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl PartialEq for Error

fn eq(&self, __arg_0: &Error) -> bool

fn ne(&self, __arg_0: &Error) -> bool

impl Eq for Error

impl Clone for Error

fn clone(&self) -> Error

1.0.0fn clone_from(&mut self, source: &Self)

impl Copy for Error

impl Debug for Error

fn fmt(&self, __arg_0: &mut Formatter) -> Result