# Trait glib::variant::FromVariant [−] [src]

    pub trait FromVariant: Sized + StaticVariantType {
        fn from_variant(variant: &Variant) -> Option<Self>;
    }

Extracts a value.

## Required Methods

### `fn from_variant(variant: &Variant) -> Option<Self>`

Tries to extract a value.

Returns `Some` if the variant's type matches `Self`.

## Implementations on Foreign Types

### `impl FromVariant for u8`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

### `impl FromVariant for i16`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

### `impl FromVariant for u16`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

### `impl FromVariant for i32`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

### `impl FromVariant for u32`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

### `impl FromVariant for i64`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

### `impl FromVariant for u64`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

### `impl FromVariant for f64`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

### `impl FromVariant for bool`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

### `impl FromVariant for String`
[src]

#### `fn from_variant(variant: &Variant) -> Option<Self>`
[src]

## Implementors

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
↑
  Move up in search results
↓
  Move down in search results
↹
  Switch tab
⏎
  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`)