pub struct SharedBPlusTree<P, KC, IC>where
P: Pager + Clone,
P::Page: Send + Sync + 'static,
P::Id: Send + Sync + 'static,
KC: KeyCodec,
IC: IdCodec<Id = P::Id>,{ /* private fields */ }Expand description
A façade that provides a serialized writer and snapshot readers,
while implementing the same BTree trait.
Implementations§
Sourcepub fn create_empty(
pager: P,
opt_shared_node_cache: Option<Arc<RwLock<NodeCache<P>>>>,
) -> Result<Self, Error>
pub fn create_empty( pager: P, opt_shared_node_cache: Option<Arc<RwLock<NodeCache<P>>>>, ) -> Result<Self, Error>
Create an empty tree + shared writer.
Sourcepub fn open(
pager: P,
root: P::Id,
opt_shared_node_cache: Option<Arc<RwLock<NodeCache<P>>>>,
) -> Self
pub fn open( pager: P, root: P::Id, opt_shared_node_cache: Option<Arc<RwLock<NodeCache<P>>>>, ) -> Self
Open a shared B+Tree backed by an existing root.
Sourcepub fn snapshot(&self) -> BPlusTree<P, KC, IC>
pub fn snapshot(&self) -> BPlusTree<P, KC, IC>
Produce a snapshot tree at the current published root.
This is a normal BPlusTree you can iterate with ScanOpts.
Trait Implementations§
Source§type Value = <BPlusTree<P, KC, IC> as BTree<'a, <KC as KeyCodec>::Key>>::Value
type Value = <BPlusTree<P, KC, IC> as BTree<'a, <KC as KeyCodec>::Key>>::Value
Tree returns zero-copy views;
must deref to
&[u8].Source§fn get_many(
&'a self,
keys: &[KC::Key],
) -> Result<Vec<Option<Self::Value>>, Error>
fn get_many( &'a self, keys: &[KC::Key], ) -> Result<Vec<Option<Self::Value>>, Error>
Batched point lookups. The output vector lines up with
keys by index.fn contains_key(&'a self, key: &KC::Key) -> Result<bool, Error>
fn insert_many(&self, items: &[(KC::Key, &[u8])]) -> Result<(), Error>
fn delete_many(&self, keys: &[KC::Key]) -> Result<(), Error>
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more