[][src]Struct sonnerie::DatabaseReader

pub struct DatabaseReader { /* fields omitted */ }

Read a database in key-timestamp sorted format.

Open a database with new and then get, get_filter or get_range to select which keys to read.

Methods

impl DatabaseReader[src]

pub fn new(dir: &Path) -> Result<DatabaseReader>[src]

Open a database at the given path.

All of the committed transactions are opened.

Any transactions that appear after new is called are not opened (create a new DatabaseReader).

pub fn without_main_db(dir: &Path) -> Result<DatabaseReader>[src]

Open a database at the given path, but not the main file.

This is only useful for doing a minor compaction.

pub fn transaction_paths(&self) -> Vec<PathBuf>[src]

Get the filenames of each transaction.

This is useful for compacting, because after compaction is complete, you would delete all of the transaction files.

This function also returns the path for main, which is overwritten. Don't delete that.

Important traits for DatabaseKeyReader<'d, 'r, RB>
pub fn get<'rdr, 'k>(
    &'rdr self,
    key: &'k str
) -> DatabaseKeyReader<'rdr, 'k, RangeInclusive<&'k str>>
[src]

Get a reader for only a single key

Returns an object that will read all of the records for only one key.

Important traits for DatabaseKeyReader<'d, 'r, RB>
pub fn get_range<'d, 'r, RB>(
    &'d self,
    range: RB
) -> DatabaseKeyReader<'d, 'r, RB> where
    RB: RangeBounds<&'r str> + Clone
[src]

Get a reader for a lexicographic range of keys

Use inclusive or exclusive range syntax to select a range.

Example: rdr.get_range("chimpan-ay" ..= "chimpan-zee")

Range queries are always efficient and readahead may occur.

Important traits for DatabaseKeyReader<'d, 'r, RB>
pub fn get_filter<'d, 'k>(
    &'d self,
    wildcard: &'k Wildcard
) -> DatabaseKeyReader<'d, 'k, RangeFrom<&'k str>>
[src]

Get a reader that filters on SQL's "LIKE"-like syntax.

A wildcard filter that has a fixed prefix, such as "chimp%" is always efficient.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,