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

pub struct Error(_);

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

Methods

impl Error
[src]

[src]

Creates an error with supplied error enum variant and message.

[src]

Checks if the error domain matches T.

[src]

Tries to convert to a specific error enum.

Returns Some if the error belongs to the enum's error domain and None otherwise.

Examples

if let Some(file_error) = error.kind::<FileError>() {
    match file_error {
        FileError::Exist => ...
        FileError::Isdir => ...
        ...
    }
}
match error {
    Some(FileError::Exist) => ...
    Some(FileError::Isdir) => ...
    ...
}

[src]

Trait Implementations

impl Clone for Error
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Error
[src]

[src]

Formats the value using the given formatter.

impl StaticType for Error
[src]

[src]

Returns the type identifier of Self.

impl Send for Error
[src]

impl Sync for Error
[src]

impl Display for Error
[src]

[src]

Formats the value using the given formatter. Read more

impl Error for Error
[src]

[src]

A short description of the error. Read more

1.0.0
[src]

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