Struct tc_btree::BTreeFile[][src]

pub struct BTreeFile<F, D, T> { /* fields omitted */ }
Expand description

The base type of a BTree

Implementations

impl<F: File<Node>, D: Dir, T: Transaction<D>> BTreeFile<F, D, T> where
    Self: Clone
[src]

pub async fn create(file: F, schema: RowSchema, txn_id: TxnId) -> TCResult<Self>[src]

Create a new BTreeFile.

Trait Implementations

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]

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.

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
    '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 BTreeFile<F, D, T>[src]

fn clone(&self) -> BTreeFile<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: File<Node>, D: Dir, T: Transaction<D>, I: BTreeInstance> CopyFrom<D, T, I> for BTreeFile<F, D, T>[src]

fn copy_from<'async_trait>(
    source: I,
    file: F,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>> where
    I: 'async_trait,
    Self: 'async_trait, 
[src]

Copy a new instance of Self from an existing instance.

impl<F, D, T> Display for BTreeFile<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> Instance for BTreeFile<F, D, T> where
    Self: Send + Sync
[src]

type Class = BTreeType

The Class type of this instance

fn class(&self) -> Self::Class[src]

Returns the [Class] of this instance.

impl<F: File<Node>, D: Dir, T: Transaction<D>> Persist<D, T> for BTreeFile<F, D, T>[src]

type Schema = RowSchema

type Store = F

fn schema(&self) -> &Self::Schema[src]

Return the schema of this persistent state.

fn load<'life0, 'async_trait>(
    txn: &'life0 T,
    schema: RowSchema,
    file: F
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Load a saved state from persistent storage.

impl<F: File<Node>, D: Dir, T: Transaction<D>> Restore<D, T> for BTreeFile<F, D, T>[src]

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

impl<F: File<Node> + Transact, D: Dir, T: Transaction<D>> Transact for BTreeFile<F, D, T>[src]

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

Commit this transaction.

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

Delete any version data specific to this transaction.

Auto Trait Implementations

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

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

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

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

impl<F, D, T> UnwindSafe for BTreeFile<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