Skip to main content

BTree

Struct BTree 

Source
pub struct BTree<S: Store> { /* private fields */ }

Implementations§

Source§

impl<S: Store> BTree<S>

Source

pub fn new(store: Arc<S>, options: BTreeOptions) -> Self

Source

pub async fn insert( &self, root: Option<&Cid>, key: &str, value: &str, ) -> Result<Cid, BTreeError>

Source

pub async fn get( &self, root: Option<&Cid>, key: &str, ) -> Result<Option<String>, BTreeError>

Source

pub async fn entries( &self, root: Option<&Cid>, ) -> Result<Vec<(String, String)>, BTreeError>

Count CID links by walking the tree.

Uses stored subtree sizes when available, but scans descendants when older roots do not carry complete counts.

Count CID links by explicitly walking the tree.

Read the stored CID-link count from the root node without scanning.

Returns Ok(None) when the root was built by older code that does not store complete subtree sizes.

Source

pub async fn range( &self, root: &Cid, start: Option<&str>, end: Option<&str>, ) -> Result<Vec<(String, String)>, BTreeError>

Source

pub async fn prefix( &self, root: &Cid, prefix: &str, ) -> Result<Vec<(String, String)>, BTreeError>

Source

pub async fn delete( &self, root: &Cid, key: &str, ) -> Result<Option<Cid>, BTreeError>

Source

pub async fn merge( &self, base: Option<&Cid>, other: Option<&Cid>, prefer_other: bool, ) -> Result<Option<Cid>, BTreeError>

Source

pub async fn build<I>(&self, items: I) -> Result<Option<Cid>, BTreeError>
where I: IntoIterator<Item = (String, String)>,

Auto Trait Implementations§

§

impl<S> Freeze for BTree<S>

§

impl<S> RefUnwindSafe for BTree<S>
where S: RefUnwindSafe,

§

impl<S> Send for BTree<S>

§

impl<S> Sync for BTree<S>

§

impl<S> Unpin for BTree<S>

§

impl<S> UnsafeUnpin for BTree<S>

§

impl<S> UnwindSafe for BTree<S>
where S: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V