Struct gmime::Error [−]
pub struct Error(_);
A generic error capable of representing various error domains (types).
Methods
impl Error
impl Error
pub fn new<T>(error: T, message: &str) -> Error where
T: ErrorDomain,
pub fn new<T>(error: T, message: &str) -> Error where
T: ErrorDomain,
Creates an error with supplied error enum variant and message.
pub fn is<T>(&self) -> bool where
T: ErrorDomain,
pub fn is<T>(&self) -> bool where
T: ErrorDomain,
Checks if the error domain matches T
.
pub fn kind<T>(&self) -> Option<T> where
T: ErrorDomain,
pub fn kind<T>(&self) -> Option<T> where
T: ErrorDomain,
Tries to convert to a specific error enum.
Returns Some
if the error belongs to the enum's error domain and
None
otherwise.
Examples
ⓘThis example is not tested
if let Some(file_error) = error.kind::<FileError>() { match file_error { FileError::Exist => ... FileError::Isdir => ... ... } }
ⓘThis example is not tested
match error { Some(FileError::Exist) => ... Some(FileError::Isdir) => ... ... }
pub fn wrap(ptr: *mut GError) -> Error
pub fn wrap(ptr: *mut GError) -> Error
Trait Implementations
impl Sync for Error
impl Sync for Error
impl Clone for Error
impl Clone for Error
fn clone(&self) -> Error
fn clone(&self) -> Error
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Error
impl Debug for Error
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Error for Error
impl Error for Error
fn description(&self) -> &str
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
1.0.0[src]
fn cause(&self) -> Option<&Error>
1.0.0
[src]The lower-level cause of this error, if any. Read more
impl Display for Error
impl Display for Error
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl StaticType for Error
impl StaticType for Error
fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl Send for Error
impl Send for Error