Trait engine_traits::Peekable[][src]

pub trait Peekable {
    type DBVector: DBVector;
    fn get_value_opt(
        &self,
        opts: &ReadOptions,
        key: &[u8]
    ) -> Result<Option<Self::DBVector>>;
fn get_value_cf_opt(
        &self,
        opts: &ReadOptions,
        cf: &str,
        key: &[u8]
    ) -> Result<Option<Self::DBVector>>; fn get_value(&self, key: &[u8]) -> Result<Option<Self::DBVector>> { ... }
fn get_value_cf(
        &self,
        cf: &str,
        key: &[u8]
    ) -> Result<Option<Self::DBVector>> { ... }
fn get_msg<M: Message + Default>(&self, key: &[u8]) -> Result<Option<M>> { ... }
fn get_msg_cf<M: Message + Default>(
        &self,
        cf: &str,
        key: &[u8]
    ) -> Result<Option<M>> { ... } }

Types from which values can be read.

Values are vectors of bytes, encapsulated in the associated DBVector type.

Method variants here allow for specifying ReadOptions, the column family to read from, or to encode the value as a protobuf message.

Associated Types

type DBVector: DBVector[src]

The byte-vector type through which the database returns read values.

Loading content...

Required methods

fn get_value_opt(
    &self,
    opts: &ReadOptions,
    key: &[u8]
) -> Result<Option<Self::DBVector>>
[src]

Read a value for a key, given a set of options.

Reads from the default column family.

Returns None if they key does not exist.

fn get_value_cf_opt(
    &self,
    opts: &ReadOptions,
    cf: &str,
    key: &[u8]
) -> Result<Option<Self::DBVector>>
[src]

Read a value for a key from a given column family, given a set of options.

Returns None if the key does not exist.

Loading content...

Provided methods

fn get_value(&self, key: &[u8]) -> Result<Option<Self::DBVector>>[src]

Read a value for a key.

Uses the default options and column family.

Returns None if the key does not exist.

fn get_value_cf(&self, cf: &str, key: &[u8]) -> Result<Option<Self::DBVector>>[src]

Read a value for a key from a given column family.

Uses the default options.

Returns None if the key does not exist.

fn get_msg<M: Message + Default>(&self, key: &[u8]) -> Result<Option<M>>[src]

Read a value and return it as a protobuf message.

fn get_msg_cf<M: Message + Default>(
    &self,
    cf: &str,
    key: &[u8]
) -> Result<Option<M>>
[src]

Read a value and return it as a protobuf message.

Loading content...

Implementors

Loading content...