# Trait ethcore_util::trie::Query [−] [src]

    pub trait Query {
        type Item;
        fn decode(self, &[u8]) -> Self::Item;

        fn record(&mut self, &H256, &[u8], u32) { ... }
    }

Description of what kind of query will be made to the trie.

This is implemented for any &mut recorder (where the query will return a DBValue), any function taking raw bytes (where no recording will be made), or any tuple of (&mut Recorder, FnOnce(&[u8]))

## Associated Types

### `type Item`

Output item.

## Required Methods

### `fn decode(self, &[u8]) -> Self::Item`

Decode a byte-slice into the desired item.

## Provided Methods

### `fn record(&mut self, &H256, &[u8], u32)`

Record that a node has been passed through.

## Implementors

- `impl<'a> Query for &'a mut Recorder`
- `impl<F, T> Query for F where F: for<'a> FnOnce(&'a [u8]) -> T`
- `impl<'a, F, T> Query for (&'a mut Recorder, F) where F: FnOnce(&[u8]) -> T`

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