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>;
#[must_use] 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<()>; #[must_use] fn count<'async_trait>(
        self,
        txn_id: TxnId
    ) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>>
    where
        Self: Send + '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: Sync + 'async_trait
, { ... }
#[must_use] 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>> { ... }
#[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
, { ... }
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> { ... }
#[must_use] 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
, { ... }
#[must_use] 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
, { ... }
#[must_use] 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>[src]

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

type Reverse: TableInstance<F, D, Txn>[src]

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

type Slice: TableInstance<F, D, Txn>[src]

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

Required methods

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.

#[must_use]
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.

Provided methods

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

Return the number of rows in this Table.

#[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: Sync + 'async_trait, 
[src]

Delete all rows in this Table.

#[must_use]
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, 
[src]

Delete the given Row from this table, if present.

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.

fn slice(self, _bounds: Bounds) -> TCResult<Self::Slice>[src]

Limit the returned rows to the given Bounds.

#[must_use]
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, 
[src]

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

#[must_use]
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, 
[src]

Update one row of this Table.

#[must_use]
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, 
[src]

Insert or update the given row.

Implementors

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

type OrderBy = Self

type Reverse = Self

type Slice = Self

fn count<'async_trait>(
    self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>> where
    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 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]

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: 'async_trait, 
[src]

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

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

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

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

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

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

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

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]

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

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

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: 'async_trait, 
[src]

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: 'async_trait, 
[src]

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]

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>

type Reverse = Merged<F, D, Txn>

type Slice = Merged<F, D, Txn>

fn count<'async_trait>(
    self,
    txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>> where
    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 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]

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

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

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

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

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

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

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]

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

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

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]

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]

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]