Enum tc_btree::BTree[][src]

pub enum BTree<F, D, T> {
    File(BTreeFile<F, D, T>),
    Slice(BTreeSlice<F, D, T>),
}
Expand description

A stateful, transaction-aware, ordered collection of Keys with O(log n) inserts and slicing

Variants

File(BTreeFile<F, D, T>)
Slice(BTreeSlice<F, D, T>)

Trait Implementations

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]

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>[src]

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

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.

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.

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. Read more

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.

#[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. Read more

impl<F: Clone, D: Clone, T: Clone> Clone for BTree<F, D, T>[src]

fn clone(&self) -> BTree<F, D, T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<F, D, T> Display for BTree<F, D, T>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<F, D, T> From<BTreeFile<F, D, T>> for BTree<F, D, T>[src]

fn from(btree: BTreeFile<F, D, T>) -> Self[src]

Performs the conversion.

impl<F, D, T> From<BTreeSlice<F, D, T>> for BTree<F, D, T>[src]

fn from(btree: BTreeSlice<F, D, T>) -> Self[src]

Performs the conversion.

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

type Context = (T, F)

The decoding context of this type, useful in situations where the stream to be decoded may be too large to hold in main memory. Read more

fn from_stream<'life0, 'async_trait, De: Decoder>(
    cxt: (T, F),
    decoder: &'life0 mut De
) -> Pin<Box<dyn Future<Output = Result<Self, De::Error>> + Send + 'async_trait>> where
    De: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Parse this value using the given Decoder.

impl<'en, F: File<Node>, D: Dir, T: Transaction<D>> Hash<'en, D> for BTree<F, D, T>[src]

type Item = Key

type Txn = T

fn hashable<'async_trait>(
    &'en self,
    txn: &'en T
) -> Pin<Box<dyn Future<Output = TCResult<TCTryStream<'en, Self::Item>>> + Send + 'async_trait>> where
    'en: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]
fn hash_hex<'async_trait>(
    &'en self,
    txn: &'en Self::Txn
) -> Pin<Box<dyn Future<Output = Result<String, TCError>> + 'async_trait + Send, Global>> where
    'en: 'async_trait,
    Self: Sync + 'async_trait, 
[src]

#[must_use]
fn hash<'async_trait>(
    &'en self,
    txn: &'en Self::Txn
) -> Pin<Box<dyn Future<Output = Result<Bytes, TCError>> + 'async_trait + Send, Global>> where
    'en: 'async_trait,
    Self: Sync + 'async_trait, 
[src]

impl<F: Send + Sync, D: Send + Sync, T: Send + Sync> Instance for BTree<F, D, T>[src]

type Class = BTreeType

The Class type of this instance

fn class(&self) -> BTreeType[src]

Returns the [Class] of this instance.

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

type Txn = T

type View = BTreeView<'en>

fn into_view<'async_trait>(
    self,
    txn: T
) -> Pin<Box<dyn Future<Output = TCResult<BTreeView<'en>>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Auto Trait Implementations

impl<F, D, T> RefUnwindSafe for BTree<F, D, T> where
    D: RefUnwindSafe,
    F: RefUnwindSafe,
    T: RefUnwindSafe

impl<F, D, T> Send for BTree<F, D, T> where
    D: Send + Sync,
    F: Send + Sync,
    T: Send + Sync

impl<F, D, T> Sync for BTree<F, D, T> where
    D: Send + Sync,
    F: Send + Sync,
    T: Send + Sync

impl<F, D, T> Unpin for BTree<F, D, T>

impl<F, D, T> UnwindSafe for BTree<F, D, T> where
    D: RefUnwindSafe,
    F: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<F, T> CastFrom<F> for T where
    T: From<F>, 
[src]

pub fn cast_from(f: F) -> T[src]

impl<T, F> CastInto<F> for T where
    F: CastFrom<T>, 
[src]

pub fn cast_into(self) -> F[src]

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<F> Match for F[src]

fn matches<T>(&self) -> bool where
    T: TryCastFrom<Self>, 
[src]

Returns true if self can be cast into the target type T.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<F, T> TryCastFrom<F> for T where
    T: CastFrom<F>, 
[src]

pub fn can_cast_from(&F) -> bool[src]

Test if value can be cast into Self.

pub fn opt_cast_from(f: F) -> Option<T>[src]

Returns Some(Self) if the source value can be cast into Self, otherwise None.

fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
    OnErr: FnOnce(&T) -> Err, 
[src]

Returns Ok(Self) if the source value can be cast into Self, otherwise calls on_err.

impl<F, T> TryCastInto<T> for F where
    T: TryCastFrom<F>, 
[src]

pub fn can_cast_into(&self) -> bool[src]

Test if self can be cast into T.

pub fn opt_cast_into(self) -> Option<T>[src]

Returns Some(T) if self can be cast into T, otherwise None.

fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
    OnErr: FnOnce(&Self) -> Err, 
[src]

Returns Ok(T) if self can be cast into T, otherwise calls on_err.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

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]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

pub fn vzip(self) -> V