[][src]Struct rdms::robt::Snapshot

pub struct Snapshot<K, V> where
    K: Clone + Ord + Serialize,
    V: Clone + Diff + Serialize
{ /* fields omitted */ }

A read only snapshot of BTree built using robt index.

Methods

impl<K, V> Snapshot<K, V> where
    K: Clone + Ord + Serialize,
    V: Clone + Diff + Serialize
[src]

pub fn open(dir: &str, name: &str) -> Result<Snapshot<K, V>>[src]

Open BTree snapshot from file that can be constructed from dir and name.

impl<K, V> Snapshot<K, V> where
    K: Clone + Ord + Serialize,
    V: Clone + Diff + Serialize
[src]

pub fn len(&self) -> usize[src]

Return number of entries in the snapshot.

pub fn to_seqno(&self) -> u64[src]

Return the last seqno found in this snapshot.

pub fn to_app_meta(&self) -> Result<Vec<u8>>[src]

Return the application metadata.

pub fn to_stats(&self) -> Result<Stats>[src]

Return Btree statistics.

pub fn to_root(&self) -> Result<u64>[src]

Return the file-position for Btree's root node.

Trait Implementations

impl<K, V> Footprint for Snapshot<K, V> where
    K: Clone + Ord + Serialize,
    V: Clone + Diff + Serialize
[src]

impl<K, V> Index<K, V> for Snapshot<K, V> where
    K: Clone + Ord + Serialize + Footprint,
    V: Clone + Diff + Serialize + Footprint,
    <V as Diff>::D: Serialize
[src]

type W = Snapshot<K, V>

A writer type, that can ingest key-value pairs, associated with this index. Read more

type R = Snapshot<K, V>

A writer type, that can ingest key-value pairs, associated with this index. Read more

fn make_new(&self) -> Result<Box<Self>>[src]

Make a new empty index of this type, with same configuration.

fn to_reader(&mut self) -> Result<Self::R>[src]

Create a new read handle, for multi-threading.

fn to_writer(&mut self) -> Result<Self::W>[src]

writes not allowed !!

impl<K, V> Reader<K, V> for Snapshot<K, V> where
    K: Clone + Ord + Serialize,
    V: Clone + Diff + Serialize,
    <V as Diff>::D: Clone + Serialize
[src]

fn iter_with_versions(&self) -> Result<IndexIter<K, V>>[src]

Iterate over all entries in this index. Returned entry shall have all its previous versions, can be a costly call.

fn range_with_versions<'a, R, Q: ?Sized>(
    &'a self,
    range: R
) -> Result<IndexIter<K, V>> where
    K: Borrow<Q>,
    R: 'a + RangeBounds<Q>,
    Q: 'a + Ord
[src]

Iterate from lower bound to upper bound. Returned entry shall have all its previous versions, can be a costly call.

fn reverse_with_versions<'a, R, Q: ?Sized>(
    &'a self,
    range: R
) -> Result<IndexIter<K, V>> where
    K: Borrow<Q>,
    R: 'a + RangeBounds<Q>,
    Q: 'a + Ord
[src]

Iterate from upper bound to lower bound. Returned entry shall have all its previous versions, can be a costly call.

impl<K, V> Writer<K, V> for Snapshot<K, V> where
    K: Clone + Ord + Serialize + Footprint,
    V: Clone + Diff + Serialize + Footprint
[src]

Auto Trait Implementations

impl<K, V> Send for Snapshot<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for Snapshot<K, V> where
    K: Sync,
    V: Sync

impl<K, V> Unpin for Snapshot<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for Snapshot<K, V> where
    K: UnwindSafe,
    V: UnwindSafe

impl<K, V> RefUnwindSafe for Snapshot<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

Blanket Implementations

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

impl<T> From<T> for 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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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