Struct tc_table::TableIndex
source · [−]pub struct TableIndex<F, D, Txn> { /* private fields */ }
Expand description
The base type of a Table
.
Implementations
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableIndex<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableIndex<F, D, Txn>
sourcepub async fn create(
context: &D,
schema: TableSchema,
txn_id: TxnId
) -> TCResult<TableIndex<F, D, Txn>> where
D::File: AsType<F>,
D::FileClass: From<BTreeType>,
pub async fn create(
context: &D,
schema: TableSchema,
txn_id: TxnId
) -> TCResult<TableIndex<F, D, Txn>> where
D::File: AsType<F>,
D::FileClass: From<BTreeType>,
Create a new TableIndex
with the given TableSchema
.
sourcepub async fn is_empty(&self, txn: &Txn) -> TCResult<bool>
pub async fn is_empty(&self, txn: &Txn) -> TCResult<bool>
Return true
if this table has zero rows.
sourcepub fn supporting_index(&self, bounds: &Bounds) -> TCResult<Index<F, D, Txn>>
pub fn supporting_index(&self, bounds: &Bounds) -> TCResult<Index<F, D, Txn>>
Return an index which supports the given Bounds
, or an error if there is none.
sourcepub async fn slice_rows<'a>(
self,
txn_id: TxnId,
bounds: Bounds,
reverse: bool
) -> TCResult<TCBoxTryStream<'a, Vec<Value>>>
pub async fn slice_rows<'a>(
self,
txn_id: TxnId,
bounds: Bounds,
reverse: bool
) -> TCResult<TCBoxTryStream<'a, Vec<Value>>>
Stream the rows within the given Bounds
from the primary index of this TableIndex
.
Trait Implementations
sourceimpl<F: Clone, D: Clone, Txn: Clone> Clone for TableIndex<F, D, Txn>
impl<F: Clone, D: Clone, Txn: Clone> Clone for TableIndex<F, D, Txn>
sourcefn clone(&self) -> TableIndex<F, D, Txn>
fn clone(&self) -> TableIndex<F, D, Txn>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>, I: TableStream + 'static> CopyFrom<D, I> for TableIndex<F, D, Txn> where
D::File: AsType<F>,
<D as Dir>::FileClass: From<BTreeType> + Send,
impl<F: File<Node>, D: Dir, Txn: Transaction<D>, I: TableStream + 'static> CopyFrom<D, I> for TableIndex<F, D, Txn> where
D::File: AsType<F>,
<D as Dir>::FileClass: From<BTreeType> + Send,
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> Display for TableIndex<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> Display for TableIndex<F, D, Txn>
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> From<TableIndex<F, D, Txn>> for Table<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> From<TableIndex<F, D, Txn>> for Table<F, D, Txn>
sourcefn from(table: TableIndex<F, D, Txn>) -> Self
fn from(table: TableIndex<F, D, Txn>) -> Self
Converts to this type from the input type.
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> Instance for TableIndex<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> Instance for TableIndex<F, D, Txn>
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> Persist<D> for TableIndex<F, D, Txn> where
D::File: AsType<F>,
<D as Dir>::FileClass: From<BTreeType> + Send,
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> Persist<D> for TableIndex<F, D, Txn> where
D::File: AsType<F>,
<D as Dir>::FileClass: From<BTreeType> + Send,
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> Restore<D> for TableIndex<F, D, Txn> where
D::File: AsType<F>,
<D as Dir>::FileClass: From<BTreeType> + Send,
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> Restore<D> for TableIndex<F, D, Txn> where
D::File: AsType<F>,
<D as Dir>::FileClass: From<BTreeType> + Send,
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableInstance for TableIndex<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableInstance for TableIndex<F, D, Txn>
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableOrder for TableIndex<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableOrder for TableIndex<F, D, Txn>
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableRead for TableIndex<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableRead for TableIndex<F, D, Txn>
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableSlice for TableIndex<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableSlice for TableIndex<F, D, Txn>
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableStream for TableIndex<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableStream for TableIndex<F, D, Txn>
type Limit = Limited<F, D, Txn>
type Selection = Selection<F, D, Txn, TableIndex<F, D, Txn>>
sourcefn count<'async_trait>(
self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>> where
Self: 'async_trait,
fn count<'async_trait>(
self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>> where
Self: 'async_trait,
Return the number of rows in this Table
.
sourceimpl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableWrite for TableIndex<F, D, Txn>
impl<F: File<Node>, D: Dir, Txn: Transaction<D>> TableWrite for TableIndex<F, D, Txn>
sourcefn delete<'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,
fn delete<'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,
Delete the given Row
from this table, if present.
sourceimpl<F: File<Node> + Transact, D: Dir, Txn: Transaction<D>> Transact for TableIndex<F, D, Txn>
impl<F: File<Node> + Transact, D: Dir, Txn: Transaction<D>> Transact for TableIndex<F, D, Txn>
Auto Trait Implementations
impl<F, D, Txn> !RefUnwindSafe for TableIndex<F, D, Txn>
impl<F, D, Txn> Send for TableIndex<F, D, Txn> where
D: Send + Sync,
F: Send + Sync,
Txn: Send + Sync,
impl<F, D, Txn> Sync for TableIndex<F, D, Txn> where
D: Send + Sync,
F: Send + Sync,
Txn: Send + Sync,
impl<F, D, Txn> Unpin for TableIndex<F, D, Txn>
impl<F, D, Txn> !UnwindSafe for TableIndex<F, D, Txn>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T)
if self
can be cast into T
, otherwise None
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.