[][src]Trait rdms::Index

pub trait Index<K, V>: Sized + Footprint where
    K: Clone + Ord + Footprint,
    V: Clone + Diff + Footprint
{ type W: Writer<K, V>; type R: Reader<K, V>; fn make_new(&self) -> Result<Box<Self>>;
fn to_reader(&mut self) -> Result<Self::R>;
fn to_writer(&mut self) -> Result<Self::W>; }

Index trait implemented by Rdms's underlying data-structures that can ingest key, value pairs.

Associated Types

type W: Writer<K, V>

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

type R: Reader<K, V>

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

Loading content...

Required methods

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

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

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

Create a new read handle, for multi-threading. Note that not all indexes allow concurrent readers. Refer to index API for more details.

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

Create a new write handle, for multi-threading. Note that not all indexes allow concurrent writers. Refer to index API for more details.

Loading content...

Implementors

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

type W = LlrbWriter<K, V>

type R = LlrbReader<K, V>

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 reader handle, for multi-threading. Llrb uses spin-lock to coordinate between readers and writers.

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

Create a new writer handle, for multi-threading. Llrb uses spin-lock to coordinate between readers and writers.

impl<K, V> Index<K, V> for Mvcc<K, V> where
    K: 'static + Send + Clone + Ord + Footprint,
    V: 'static + Send + Clone + Diff + Footprint,
    <V as Diff>::D: Send
[src]

type W = MvccWriter<K, V>

type R = MvccReader<K, V>

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]

Lockless concurrent readers are supported

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

Create a new writer handle. Multiple writers uses spin-lock to serialize write operation.

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

type W = NoDisk<K, V>

type R = NoDisk<K, V>

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>

type R = Snapshot<K, V>

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 !!

Loading content...