Struct tc_tensor::SparseTable
source · pub struct SparseTable<FD, FS, D, T> { /* private fields */ }
Expand description
The base accessor type of SparseTensor
, implementing SparseAccess
for a TableIndex
.
Trait Implementations§
source§impl<FD: Clone, FS: Clone, D: Clone, T: Clone> Clone for SparseTable<FD, FS, D, T>
impl<FD: Clone, FS: Clone, D: Clone, T: Clone> Clone for SparseTable<FD, FS, D, T>
source§fn clone(&self) -> SparseTable<FD, FS, D, T>
fn clone(&self) -> SparseTable<FD, FS, D, T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<FD, FS, D, T, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
impl<FD, FS, D, T, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
source§impl<FD, FS, D, T> Display for SparseTable<FD, FS, D, T>
impl<FD, FS, D, T> Display for SparseTable<FD, FS, D, T>
source§impl<FD, FS, D, T> FromStream for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
impl<FD, FS, D, T> FromStream for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
§type Context = (SparseTable<FD, FS, D, T>, TxnId)
type Context = (SparseTable<FD, FS, D, T>, TxnId)
The decoding context of this type, useful in situations where the stream to be decoded
may be too large to hold in main memory. Read more
source§impl<FD, FS, D, T> Persist<D> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
impl<FD, FS, D, T> Persist<D> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
type Txn = T
type Schema = Schema
source§fn create(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
fn create(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
Create a new instance of
Self
from an empty Store
.source§fn load(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
fn load(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
Load a saved instance of
Self
from persistent storage.
Should only be invoked at startup time.source§impl<FD, FS, D, T> Restore<D> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
impl<FD, FS, D, T> Restore<D> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
source§impl<FD, FS, D, T> SparseAccess<FD, FS, D, T> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> SparseAccess<FD, FS, D, T> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
D::Write: DirCreateFile<FD>,
§type Slice = SparseAccessor<FD, FS, D, T>
type Slice = SparseAccessor<FD, FS, D, T>
The type of a slice of this accessor
source§fn accessor(self) -> SparseAccessor<FD, FS, D, T>
fn accessor(self) -> SparseAccessor<FD, FS, D, T>
Return this accessor as a
SparseAccessor
.source§fn filled<'a, 'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<Pin<Box<dyn Stream<Item = TCResult<(Coord, Number)>> + Send + Unpin + 'a>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn filled<'a, 'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<Pin<Box<dyn Stream<Item = TCResult<(Coord, Number)>> + Send + Unpin + 'a>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
source§fn filled_at<'a, 'async_trait>(
self,
txn: T,
axes: Vec<usize>
) -> Pin<Box<dyn Future<Output = TCResult<TCBoxTryStream<'a, Coords>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn filled_at<'a, 'async_trait>(
self,
txn: T,
axes: Vec<usize>
) -> Pin<Box<dyn Future<Output = TCResult<TCBoxTryStream<'a, Coords>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
source§fn filled_count<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
fn filled_count<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
Return the number of nonzero values in this
SparseTensor
.source§fn is_empty<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
fn is_empty<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
Return
true
if this SparseTensor
contains no elements.source§impl<FD, FS, D, T> SparseWrite for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
TableIndex<FS, D, T>: TableWrite,
Self: TensorAccess + Send + Sync,
impl<FD, FS, D, T> SparseWrite for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
TableIndex<FS, D, T>: TableWrite,
Self: TensorAccess + Send + Sync,
source§impl<FD, FS, D, T> TensorAccess for SparseTable<FD, FS, D, T>
impl<FD, FS, D, T> TensorAccess for SparseTable<FD, FS, D, T>
source§impl<FD, FS, D, T> Transact for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
TableIndex<FS, D, T>: Transact,
impl<FD, FS, D, T> Transact for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
TableIndex<FS, D, T>: Transact,
§type Commit = <TableIndex<FS, D, T> as Transact>::Commit
type Commit = <TableIndex<FS, D, T> as Transact>::Commit
A guard which blocks concurrent commits
source§fn commit<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = Self::Commit> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn commit<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = Self::Commit> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Commit this transaction.
Auto Trait Implementations§
impl<FD, FS, D, T> !RefUnwindSafe for SparseTable<FD, FS, D, T>
impl<FD, FS, D, T> Send for SparseTable<FD, FS, D, T>where
D: Send + Sync,
FD: Send,
FS: Send + Sync,
T: Send + Sync,
impl<FD, FS, D, T> Sync for SparseTable<FD, FS, D, T>where
D: Send + Sync,
FD: Sync,
FS: Send + Sync,
T: Send + Sync,
impl<FD, FS, D, T> Unpin for SparseTable<FD, FS, D, T>where
FD: Unpin,
impl<FD, FS, D, T> !UnwindSafe for SparseTable<FD, FS, D, T>
Blanket Implementations§
source§impl<F> Match for F
impl<F> Match for F
source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.source§fn 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
.