Struct robt::db::Index[][src]

pub struct Index<K, V, D, B> { /* fields omitted */ }

Index type, immutable, durable, fully-packed and lockless reads.

Implementations

impl<K, V, D, B> Index<K, V, D, B>[src]

pub fn open(dir: &OsStr, name: &str) -> Result<Index<K, V, D, B>> where
    K: FromCbor,
    V: FromCbor,
    D: FromCbor,
    B: Bloom
[src]

Open an existing index for read-only.

pub fn open_file(file: &OsStr) -> Result<Index<K, V, D, B>> where
    K: FromCbor,
    V: FromCbor,
    D: FromCbor,
    B: Bloom
[src]

Open an existing index for read-only, from index file. file must be supplied along with full-path.

pub fn set_bitmap(&mut self, bitmap: B)[src]

Optionally set a different bitmap over this index. Know what you are doing before calling this API.

pub fn try_clone(&self) -> Result<Self> where
    K: FromCbor,
    V: FromCbor,
    D: FromCbor
[src]

Clone this index instance, with its underlying meta-data shared across index instances. Note that file-descriptors are not shared.

pub fn compact(self, config: Config, bitmap: B, cutoff: Cutoff) -> Result<Self> where
    K: Clone + Ord + Hash + FromCbor + IntoCbor,
    V: Clone + FromCbor + IntoCbor,
    D: Clone + FromCbor + IntoCbor,
    B: Bloom
[src]

Compact this index into a new index specified by Config. The bitmap argument carry same meaning as that of build_index method. Refer to package documentation to know more about Cutoff.

pub fn close(self) -> Result<()>[src]

Close this index, releasing OS resources. To purge, call purge() method.

pub fn purge(self) -> Result<()>[src]

Purge this index from disk.

impl<K, V, D, B> Index<K, V, D, B>[src]

pub fn to_name(&self) -> String[src]

pub fn to_app_metadata(&self) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

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

pub fn as_bitmap(&self) -> &B[src]

pub fn to_bitmap(&self) -> B where
    B: Clone
[src]

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

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

pub fn is_compacted(&self) -> bool[src]

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

pub fn is_empty(&self) -> bool[src]

pub fn to_index_file_location(&self) -> OsString[src]

pub fn to_vlog_file_location(&self) -> Option<OsString>[src]

pub fn get<Q>(&mut self, key: &Q) -> Result<Entry<K, V, D>> where
    K: Clone + Borrow<Q> + FromCbor,
    V: Clone + FromCbor,
    D: Clone + FromCbor,
    Q: Ord
[src]

pub fn get_versions<Q>(&mut self, key: &Q) -> Result<Entry<K, V, D>> where
    K: Clone + Borrow<Q> + FromCbor,
    V: Clone + FromCbor,
    D: Clone + FromCbor,
    Q: Ord
[src]

pub fn iter<Q, R>(&mut self, range: R) -> Result<Iter<'_, K, V, D>> where
    K: Clone + Ord + Borrow<Q> + FromCbor,
    V: Clone + FromCbor,
    D: Clone + FromCbor,
    Q: Ord + ToOwned<Owned = K>,
    R: RangeBounds<Q>, 
[src]

pub fn reverse<Q, R>(&mut self, range: R) -> Result<Iter<'_, K, V, D>> where
    K: Clone + Ord + Borrow<Q> + FromCbor,
    V: Clone + FromCbor,
    D: Clone + FromCbor,
    Q: Ord + ToOwned<Owned = K>,
    R: RangeBounds<Q>, 
[src]

pub fn iter_versions<Q, R>(&mut self, range: R) -> Result<Iter<'_, K, V, D>> where
    K: Clone + Ord + Borrow<Q> + FromCbor,
    V: Clone + FromCbor,
    D: Clone + FromCbor,
    Q: Ord + ToOwned<Owned = K>,
    R: RangeBounds<Q>, 
[src]

pub fn reverse_versions<Q, R>(&mut self, range: R) -> Result<Iter<'_, K, V, D>> where
    K: Clone + Ord + Borrow<Q> + FromCbor,
    V: Clone + FromCbor,
    D: Clone + FromCbor,
    Q: Ord + ToOwned<Owned = K>,
    R: RangeBounds<Q>, 
[src]

pub fn validate(&mut self) -> Result<Stats> where
    K: Clone + PartialOrd + Ord + Debug + FromCbor,
    V: Clone + FromCbor,
    D: Clone + FromCbor
[src]

pub fn print(&mut self) -> Result<()> where
    K: Clone + FromCbor + Debug,
    V: Clone + FromCbor + Debug,
    D: Clone + FromCbor + Debug,
    B: Bloom
[src]

Auto Trait Implementations

impl<K, V, D, B> RefUnwindSafe for Index<K, V, D, B> where
    B: RefUnwindSafe,
    D: RefUnwindSafe,
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V, D, B> Send for Index<K, V, D, B> where
    B: Send + Sync,
    D: Send,
    K: Send,
    V: Send

impl<K, V, D, B> Sync for Index<K, V, D, B> where
    B: Send + Sync,
    D: Sync,
    K: Sync,
    V: Sync

impl<K, V, D, B> Unpin for Index<K, V, D, B> where
    D: Unpin,
    K: Unpin,
    V: Unpin

impl<K, V, D, B> UnwindSafe for Index<K, V, D, B> where
    B: RefUnwindSafe,
    D: UnwindSafe,
    K: UnwindSafe,
    V: UnwindSafe

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.