Trait mtbl::Read [] [src]

pub trait Read {
    fn raw_mtbl_source(&self) -> &*const mtbl_source;

    fn get<T>(&self, key: T) -> Option<Vec<u8>> where Self: Sized, T: AsRef<[u8]> { ... }
    fn iter(&self) -> Iter { ... }
    fn get_prefix<T>(&self, prefix: T) -> Iter where Self: Sized, T: AsRef<[u8]> { ... }
    fn get_range<T, U>(&self, key0: T, key1: U) -> Iter where Self: Sized, T: AsRef<[u8]>, U: AsRef<[u8]> { ... }
}

A trait for objects that can read keys from an MTBL file.

A Read is accessed like a sorted map, with each key mapping to one value. Keys and values are both byte sequences, passed around as slices or vectors. Because it's a sorted map, you can access not just via an exact key but also by a key prefix or range.

Required Methods

Get the internal mtbl_source pointer.

Provided Methods

Get the value of a key, if it's present.

Get an iterator over all keys and values.

Get an iterator over all keys and values where the key starts with the given prefix.

Get an iterator over all keys and values, where the keys are between key0 and key1 (inclusive).

Trait Implementations

impl<'a> IntoIterator for &'a Read
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Implementors