Trait tc_table::TableInstance [−][src]
pub trait TableInstance<F: File<Node>, D: Dir, Txn: Transaction<D>>: Instance<Class = TableType> + Clone + Sized + Into<Table<F, D, Txn>> { type OrderBy: TableInstance<F, D, Txn>; type Reverse: TableInstance<F, D, Txn>; type Slice: TableInstance<F, D, Txn>;}Show methods
fn key(&self) -> &[Column]; fn values(&self) -> &[Column]; fn schema(&self) -> TableSchema; fn order_by(
self,
columns: Vec<Id>,
reverse: bool
) -> TCResult<Self::OrderBy>; fn reversed(self) -> TCResult<Self::Reverse>; 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; fn validate_bounds(&self, bounds: &Bounds) -> TCResult<()>; fn validate_order(&self, order: &[Id]) -> TCResult<()>; fn count<'async_trait>(
self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>>
where
Self: Send + 'async_trait, { ... } fn delete<'life0, 'async_trait>(
&'life0 self,
_txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: Sync + 'async_trait, { ... } 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: Sync + 'async_trait, { ... } fn group_by(
self,
columns: Vec<Id>
) -> TCResult<Aggregate<F, D, Txn, Self::OrderBy>> { ... } 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, { ... } fn limit(self, limit: u64) -> Limited<F, D, Txn> { ... } fn select(self, columns: Vec<Id>) -> TCResult<Selection<F, D, Txn, Self>> { ... } fn slice(self, _bounds: Bounds) -> TCResult<Self::Slice> { ... } fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
_txn: &'life1 Txn,
_value: 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: Sync + 'async_trait, { ... } fn update_row<'life0, 'async_trait>(
&'life0 self,
_txn_id: TxnId,
_row: Row,
_value: Row
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: Sync + 'async_trait, { ... } fn upsert<'life0, 'async_trait>(
&'life0 self,
_txn_id: TxnId,
_key: Vec<Value>,
_value: Vec<Value>
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: Sync + 'async_trait, { ... }
Expand description
Common Table methods.
Associated Types
type OrderBy: TableInstance<F, D, Txn>
type OrderBy: TableInstance<F, D, Txn>The type of Table returned by this instance’s order_by method.
type Reverse: TableInstance<F, D, Txn>
type Reverse: TableInstance<F, D, Txn>The type of Table returned by this instance’s reversed method.
type Slice: TableInstance<F, D, Txn>
type Slice: TableInstance<F, D, Txn>The type of Table returned by this instance’s slice method.
Required methods
fn schema(&self) -> TableSchema
fn schema(&self) -> TableSchemaReturn the schema of this Table.
Set the order returned by rows.
Return a stream of the rows in this Table.
fn validate_bounds(&self, bounds: &Bounds) -> TCResult<()>
fn validate_bounds(&self, bounds: &Bounds) -> TCResult<()>Return an error if this table does not support the given Bounds.
Provided methods
Return the number of rows in this Table.
Delete all rows in this Table.
Delete the given Row from this table, if present.
Group this Table by the given columns.
Construct and return a temporary index of the given columns.
Limit the columns returned by rows.
Limit the returned rows to the given Bounds.
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
_txn: &'life1 Txn,
_value: 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: Sync + 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
_txn: &'life1 Txn,
_value: 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: Sync + 'async_trait, Update the values of the columns in this Table to match the given Row.
Update one row of this Table.
Implementors
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableInstance<F, D, Txn> for Table<F, D, Txn> where
Self: Send + Sync, impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableInstance<F, D, Txn> for Merged<F, D, Txn>impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableInstance<F, D, Txn> for TableIndex<F, D, Txn>