Trait tc_btree::BTreeInstance[][src]

pub trait BTreeInstance: Clone + Instance {
    type Slice: BTreeInstance;
    fn collator(&self) -> &ValueCollator;
fn schema(&self) -> &RowSchema;
fn slice(self, range: Range, reverse: bool) -> TCResult<Self::Slice>;
#[must_use] fn is_empty<'life0, 'async_trait>(
        &'life0 self,
        txn_id: TxnId
    ) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn delete<'life0, 'async_trait>(
        &'life0 self,
        txn_id: TxnId
    ) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn insert<'life0, 'async_trait>(
        &'life0 self,
        txn_id: TxnId,
        key: Key
    ) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn keys<'a, 'async_trait>(
        self,
        txn_id: TxnId
    ) -> Pin<Box<dyn Future<Output = TCResult<TCTryStream<'a, Key>>> + Send + 'async_trait>>
    where
        Self: 'a,
        'a: 'async_trait,
        Self: 'async_trait
; #[must_use] fn count<'life0, 'async_trait>(
        &'life0 self,
        txn_id: TxnId
    ) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] fn try_insert_from<'life0, 'async_trait, S: Stream<Item = TCResult<Key>> + Send + Unpin>(
        &'life0 self,
        txn_id: TxnId,
        keys: S
    ) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
    where
        S: 'async_trait,
        'life0: 'async_trait,
        Self: Sync + 'async_trait
, { ... } }
Expand description

Common BTree methods.

Associated Types

Required methods

fn collator(&self) -> &ValueCollator[src]

Return a reference to this BTree’s collator.

fn schema(&self) -> &RowSchema[src]

Return a reference to this BTree’s schema.

fn slice(self, range: Range, reverse: bool) -> TCResult<Self::Slice>[src]

Return a slice of this BTree’s with the given range.

#[must_use]
fn is_empty<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Return true if this BTree has no Keys.

#[must_use]
fn delete<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Delete all the Keys in this BTree.

#[must_use]
fn insert<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId,
    key: Key
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Insert the given Key into this BTree.

If the Key is already present, this is a no-op.

#[must_use]
fn keys<'a, 'async_trait>(
    self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<TCTryStream<'a, Key>>> + Send + 'async_trait>> where
    Self: 'a,
    'a: 'async_trait,
    Self: 'async_trait, 
[src]

Return a Stream of this BTree’s Keys.

Provided methods

#[must_use]
fn count<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: Sync + 'async_trait, 
[src]

Return the number of Keys in this BTree.

#[must_use]
fn try_insert_from<'life0, 'async_trait, S: Stream<Item = TCResult<Key>> + Send + Unpin>(
    &'life0 self,
    txn_id: TxnId,
    keys: S
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    S: 'async_trait,
    'life0: 'async_trait,
    Self: Sync + 'async_trait, 
[src]

Insert all the keys from the given Stream into this BTree.

This will stop and return an error if it encounters an invalid Key.

Implementors

impl<F: File<Node>, D: Dir, T: Transaction<D>> BTreeInstance for BTree<F, D, T> where
    Self: 'static, 
[src]

type Slice = Self

fn collator(&self) -> &ValueCollator[src]

fn schema(&self) -> &RowSchema[src]

fn slice(self, range: Range, reverse: bool) -> TCResult<Self>[src]

fn is_empty<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn delete<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn insert<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId,
    key: Key
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn keys<'a, 'async_trait>(
    self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<TCTryStream<'a, Key>>> + Send + 'async_trait>> where
    Self: 'a,
    'a: 'async_trait,
    Self: 'async_trait, 
[src]

impl<F: File<Node>, D: Dir, T: Transaction<D>> BTreeInstance for BTreeFile<F, D, T> where
    Self: Clone,
    BTreeSlice<F, D, T>: 'static, 
[src]

type Slice = BTreeSlice<F, D, T>

fn collator(&self) -> &ValueCollator[src]

fn schema(&self) -> &RowSchema[src]

fn slice(self, range: Range, reverse: bool) -> TCResult<Self::Slice>[src]

fn is_empty<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn delete<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn insert<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId,
    key: Key
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn keys<'a, 'async_trait>(
    self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<TCTryStream<'a, Key>>> + Send + 'async_trait>> where
    'a: 'async_trait,
    Self: 'async_trait, 
[src]

impl<F: File<Node>, D: Dir, T: Transaction<D>> BTreeInstance for BTreeSlice<F, D, T> where
    BTreeFile<F, D, T>: Clone + 'static, 
[src]

type Slice = Self

fn collator(&self) -> &ValueCollator[src]

fn schema(&self) -> &RowSchema[src]

fn slice(self, range: Range, reverse: bool) -> TCResult<Self::Slice>[src]

fn is_empty<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn delete<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn insert<'life0, 'async_trait>(
    &'life0 self,
    txn_id: TxnId,
    key: Key
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn keys<'a, 'async_trait>(
    self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<TCTryStream<'a, Key>>> + Send + 'async_trait>> where
    'a: 'async_trait,
    Self: 'async_trait, 
[src]