Struct robt::db::Index [−][src]
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]
K: FromCbor,
V: FromCbor,
D: FromCbor,
B: Bloom,
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]
K: FromCbor,
V: FromCbor,
D: FromCbor,
B: Bloom,
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]
K: FromCbor,
V: FromCbor,
D: FromCbor,
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]
K: Clone + Ord + Hash + FromCbor + IntoCbor,
V: Clone + FromCbor + IntoCbor,
D: Clone + FromCbor + IntoCbor,
B: Bloom,
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>ⓘ
[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]
B: Clone,
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]
K: Clone + Borrow<Q> + FromCbor,
V: Clone + FromCbor,
D: Clone + FromCbor,
Q: Ord,
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]
K: Clone + Borrow<Q> + FromCbor,
V: Clone + FromCbor,
D: Clone + FromCbor,
Q: Ord,
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]
K: Clone + Ord + Borrow<Q> + FromCbor,
V: Clone + FromCbor,
D: Clone + FromCbor,
Q: Ord + ToOwned<Owned = K>,
R: RangeBounds<Q>,
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]
K: Clone + Ord + Borrow<Q> + FromCbor,
V: Clone + FromCbor,
D: Clone + FromCbor,
Q: Ord + ToOwned<Owned = K>,
R: RangeBounds<Q>,
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]
K: Clone + Ord + Borrow<Q> + FromCbor,
V: Clone + FromCbor,
D: Clone + FromCbor,
Q: Ord + ToOwned<Owned = K>,
R: RangeBounds<Q>,
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]
K: Clone + Ord + Borrow<Q> + FromCbor,
V: Clone + FromCbor,
D: Clone + FromCbor,
Q: Ord + ToOwned<Owned = K>,
R: RangeBounds<Q>,
pub fn validate(&mut self) -> Result<Stats> where
K: Clone + PartialOrd + Ord + Debug + FromCbor,
V: Clone + FromCbor,
D: Clone + FromCbor,
[src]
K: Clone + PartialOrd + Ord + Debug + FromCbor,
V: Clone + FromCbor,
D: Clone + FromCbor,
pub fn print(&mut self) -> Result<()> where
K: Clone + FromCbor + Debug,
V: Clone + FromCbor + Debug,
D: Clone + FromCbor + Debug,
B: Bloom,
[src]
K: Clone + FromCbor + Debug,
V: Clone + FromCbor + Debug,
D: Clone + FromCbor + Debug,
B: Bloom,
Auto Trait Implementations
impl<K, V, D, B> RefUnwindSafe for Index<K, V, D, B> where
B: RefUnwindSafe,
D: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
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,
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,
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,
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,
B: RefUnwindSafe,
D: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,