# [−] [src] Trait wasmi::FromRuntimeValue

    pub trait FromRuntimeValue where
        Self: Sized, {
        fn from_runtime_value(val: RuntimeValue) -> Option<Self>;
    }

Trait for creating value from a `RuntimeValue`.

Typically each implementation can create a value from the specific type. For example, values of type `bool` or `u32` are both represented by `I32` and `f64` values are represented by `F64`.

## Required methods

### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>`

Create a value of type `Self` from a given `RuntimeValue`.

Returns `None` if the `RuntimeValue` is of type different than expected by the conversion in question.

Loading content...

## Implementations on Foreign Types

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

This conversion assumes that boolean values are represented by `I32` type.

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

### `impl FromRuntimeValue for i8` [src]

This conversion assumes that `i8` is represented as an `I32`.

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

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

This conversion assumes that `i16` is represented as an `I32`.

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

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

This conversion assumes that `u8` is represented as an `I32`.

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

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

This conversion assumes that `u16` is represented as an `I32`.

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

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

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

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

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

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

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

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

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

Loading content...

## Implementors

### `impl FromRuntimeValue for F32` [src]

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

### `impl FromRuntimeValue for F64` [src]

#### `fn from_runtime_value(val: RuntimeValue) -> Option<Self>` [src]

Loading content...

# 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
`+`
  Expand all sections
`-`
  Collapse 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`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)