Struct glib::error::Error[][src]

pub struct Error(_);

A generic error capable of representing various error domains (types).

Methods

impl Error
[src]

Creates an error with supplied error enum variant and message.

Checks if the error domain matches T.

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) => ...
    ...
}

Trait Implementations

impl PartialEq for Error
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Error
[src]

impl PartialOrd for Error
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for Error
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Hash for Error
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Clone for Error
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl StaticType for Error
[src]

Returns the type identifier of Self.

impl Send for Error
[src]

impl Sync for Error
[src]

impl Display for Error
[src]

Formats the value using the given formatter. Read more

impl Error for Error
[src]

This method is soft-deprecated. Read more

The lower-level cause of this error, if any. Read more

impl Debug for Error
[src]

Formats the value using the given formatter. Read more