# Struct gdk::Error [−] [src]

    pub struct Error(_);

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

## Methods

### `impl Error`
[src]

#### `fn new<T>(error: T, message: &str) -> Error where
T: ErrorDomain,`

Creates an error with supplied error enum variant and message.

#### `fn is<T>(&self) -> bool where
T: ErrorDomain,`

Checks if the error domain matches `T`.

#### `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

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

    match error {
        Some(FileError::Exist) => ...
        Some(FileError::Isdir) => ...
        ...
    }

#### `fn wrap(ptr: *mut GError) -> Error`

## Trait Implementations

### `impl Clone for Error`
[src]

#### `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

### `impl Error for Error`
[src]

#### `fn description(&self) -> &str`

### `impl Debug for Error`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>`

Formats the value using the given formatter.

### `impl Display for Error`
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result<(), Error>`

Formats the value using the given formatter. Read more

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)