Struct tc_table::TableIndex[][src]

pub struct TableIndex<F: File<Node>, D: Dir, Txn: Transaction<D>> { /* fields omitted */ }
Expand description

The base type of a Table.

Implementations

impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableIndex<F, D, Txn>[src]

pub async fn create(
    schema: TableSchema,
    context: &D,
    txn_id: TxnId
) -> TCResult<TableIndex<F, D, Txn>> where
    F: TryFrom<D::File, Error = TCError>,
    D::FileClass: From<BTreeType>, 
[src]

pub async fn is_empty(&self, txn: &Txn) -> TCResult<bool>[src]

pub fn merge_bounds(&self, all_bounds: Vec<Bounds>) -> TCResult<Bounds>[src]

pub fn primary(&self) -> &Index<F, D, Txn>[src]

pub fn supporting_index(&self, bounds: &Bounds) -> TCResult<Index<F, D, Txn>>[src]

pub async fn get(
    &self,
    txn_id: TxnId,
    key: Vec<Value>
) -> TCResult<Option<Vec<Value>>>
[src]

pub async fn upsert(
    &self,
    txn_id: TxnId,
    key: Vec<Value>,
    values: Vec<Value>
) -> TCResult<()>
[src]

pub async fn slice_rows<'a>(
    self,
    txn_id: TxnId,
    bounds: Bounds,
    reverse: bool
) -> TCResult<TCTryStream<'a, Vec<Value>>>
[src]

Trait Implementations

impl<F: Clone + File<Node>, D: Clone + Dir, Txn: Clone + Transaction<D>> Clone for TableIndex<F, D, Txn>[src]

fn clone(&self) -> TableIndex<F, D, Txn>[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, Txn: Transaction<D>, I: TableInstance<F, D, Txn>> CopyFrom<D, Txn, I> for TableIndex<F, D, Txn> where
    F: TryFrom<D::File, Error = TCError>,
    <D as Dir>::FileClass: From<BTreeType> + Send
[src]

fn copy_from<'async_trait>(
    source: I,
    dir: D,
    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: File<Node>, D: Dir, Txn: Transaction<D>> Display for TableIndex<F, D, Txn>[src]

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

Formats the value using the given formatter. Read more

impl<F: File<Node>, D: Dir, Txn: Transaction<D>> From<TableIndex<F, D, Txn>> for Table<F, D, Txn>[src]

fn from(table: TableIndex<F, D, Txn>) -> Self[src]

Performs the conversion.

impl<F: File<Node>, D: Dir, Txn: Transaction<D>> Instance for TableIndex<F, D, Txn>[src]

type Class = TableType

The Class type of this instance

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

Returns the [Class] of this instance.

impl<F: File<Node>, D: Dir, Txn: Transaction<D>> Persist<D, Txn> for TableIndex<F, D, Txn> where
    F: TryFrom<D::File, Error = TCError>,
    <D as Dir>::FileClass: From<BTreeType> + Send
[src]

type Schema = TableSchema

type Store = D

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

Return the schema of this persistent state.

fn load<'life0, 'async_trait>(
    txn: &'life0 Txn,
    schema: Self::Schema,
    store: Self::Store
) -> 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, Txn: Transaction<D>> Restore<D, Txn> for TableIndex<F, D, Txn>[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>, D: Dir, Txn: Transaction<D>> TableInstance<F, D, Txn> for TableIndex<F, D, Txn>[src]

type OrderBy = Merged<F, D, Txn>

The type of Table returned by this instance’s order_by method.

type Reverse = Merged<F, D, Txn>

The type of Table returned by this instance’s reversed method.

type Slice = Merged<F, D, Txn>

The type of Table returned by this instance’s slice method.

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

Return the number of rows in this Table.

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 rows in this Table.

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

Delete the given Row from this table, if present.

fn key(&self) -> &[Column][src]

Return the schema of this Table’s key.

fn values(&self) -> &[Column][src]

Return the schema of this Table’s values.

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

Return the schema of this Table.

fn order_by(self, columns: Vec<Id>, reverse: bool) -> TCResult<Self::OrderBy>[src]

Set the order returned by rows.

fn reversed(self) -> TCResult<Self::Reverse>[src]

Reverse the order returned by rows.

fn slice(self, bounds: Bounds) -> TCResult<Merged<F, D, Txn>>[src]

Limit the returned rows to the given Bounds.

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

Return a stream of the rows in this Table.

fn validate_bounds(&self, bounds: &Bounds) -> TCResult<()>[src]

Return an error if this table does not support the given Bounds.

fn validate_order(&self, order: &[Id]) -> TCResult<()>[src]

Return an error if this table does not support ordering by the given columns.

fn update<'life0, 'life1, 'async_trait>(
    &'life0 self,
    txn: &'life1 Txn,
    update: Row
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>> where
    F: TryFrom<D::File, Error = TCError>,
    D::FileClass: From<BTreeType>,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Update the values of the columns in this Table to match the given Row.

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

Update one row of this Table.

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

Insert or update the given row.

fn group_by(
    self,
    columns: Vec<Id>
) -> TCResult<Aggregate<F, D, Txn, Self::OrderBy>>
[src]

Group this Table by the given columns.

#[must_use]
fn index<'async_trait>(
    self,
    txn: Txn,
    columns: Option<Vec<Id>>
) -> Pin<Box<dyn Future<Output = TCResult<ReadOnly<F, D, Txn>>> + Send + 'async_trait>> where
    F: TryFrom<D::File, Error = TCError>,
    D::FileClass: From<BTreeType>,
    Self: Send + 'async_trait, 
[src]

Construct and return a temporary index of the given columns.

fn limit(self, limit: u64) -> Limited<F, D, Txn>[src]

Limit the number of rows returned by rows.

fn select(self, columns: Vec<Id>) -> TCResult<Selection<F, D, Txn, Self>>[src]

Limit the columns returned by rows.

impl<F: File<Node> + Transact, D: Dir, Txn: Transaction<D>> Transact for TableIndex<F, D, Txn>[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, Txn> RefUnwindSafe for TableIndex<F, D, Txn> where
    D: RefUnwindSafe,
    F: RefUnwindSafe,
    Txn: RefUnwindSafe

impl<F, D, Txn> Send for TableIndex<F, D, Txn>

impl<F, D, Txn> Sync for TableIndex<F, D, Txn>

impl<F, D, Txn> Unpin for TableIndex<F, D, Txn>

impl<F, D, Txn> UnwindSafe for TableIndex<F, D, Txn> where
    D: RefUnwindSafe,
    F: RefUnwindSafe,
    Txn: 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