pub struct BTree<S, C, G> { /* private fields */ }
Expand description
A B+Tree
Implementations§
Source§impl<S, C, FE, G> BTree<S, C, G>
impl<S, C, FE, G> BTree<S, C, G>
Sourcepub async fn contains(&self, key: &[S::Value]) -> Result<bool, Error>
pub async fn contains(&self, key: &[S::Value]) -> Result<bool, Error>
Return true
if this B+Tree contains the given key
.
Sourcepub async fn count<BV>(&self, range: &Range<BV>) -> Result<u64, Error>
pub async fn count<BV>(&self, range: &Range<BV>) -> Result<u64, Error>
Count how many keys lie within the given range
of this B+Tree.
Sourcepub async fn first<BV>(
&self,
range: Range<BV>,
) -> Result<Option<Key<S::Value>>, Error>
pub async fn first<BV>( &self, range: Range<BV>, ) -> Result<Option<Key<S::Value>>, Error>
Return the first key in this B+Tree within the given range
, if any.
Source§impl<S, C, FE, G> BTree<S, C, G>
impl<S, C, FE, G> BTree<S, C, G>
Sourcepub async fn keys<BV>(
self,
range: Range<BV>,
reverse: bool,
) -> Result<Keys<S::Value>, Error>
pub async fn keys<BV>( self, range: Range<BV>, reverse: bool, ) -> Result<Keys<S::Value>, Error>
Construct a Stream
of all the keys in the given range
of this B+Tree.
Sourcepub async fn groups<BV>(
self,
range: Range<BV>,
n: usize,
reverse: bool,
) -> Result<Keys<S::Value>, Error>
pub async fn groups<BV>( self, range: Range<BV>, n: usize, reverse: bool, ) -> Result<Keys<S::Value>, Error>
Construct a Stream
of unique length-n
prefixes within the given range
.
pub async fn is_valid(self) -> Result<bool, Error>
Source§impl<S, C, FE> BTree<S, C, DirWriteGuardOwned<FE>>
impl<S, C, FE> BTree<S, C, DirWriteGuardOwned<FE>>
Sourcepub fn downgrade(self) -> BTreeReadGuard<S, C, FE>
pub fn downgrade(self) -> BTreeReadGuard<S, C, FE>
Downgrade this BTreeWriteGuard
into a BTreeReadGuard
.
Source§impl<S, C, FE> BTree<S, C, DirWriteGuardOwned<FE>>
impl<S, C, FE> BTree<S, C, DirWriteGuardOwned<FE>>
Trait Implementations§
Auto Trait Implementations§
impl<S, C, G> Freeze for BTree<S, C, G>
impl<S, C, G> RefUnwindSafe for BTree<S, C, G>
impl<S, C, G> Send for BTree<S, C, G>
impl<S, C, G> Sync for BTree<S, C, G>
impl<S, C, G> Unpin for BTree<S, C, G>
impl<S, C, G> UnwindSafe for BTree<S, C, G>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F> Match for F
impl<F> Match for F
Source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.Source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
Source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.Source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.Source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
Source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.Source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns
Some(T)
if self
can be cast into T
, otherwise None
.Source§fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
Returns
Ok(T)
if self
can be cast into T
, otherwise calls on_err
.