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.
Implementations
Trait Implementations
sourceimpl<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>
sourcefn 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 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<FD, FS, D, T, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
A: SparseAccess<FD, FS, D, T>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
A: SparseAccess<FD, FS, D, T>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
sourceimpl<FD, FS, D, T> Display for SparseTable<FD, FS, D, T>
impl<FD, FS, D, T> Display for SparseTable<FD, FS, D, T>
sourceimpl<FD, FS, D, T> FromStream for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> FromStream for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
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
sourceimpl<FD, FS, D, T> Persist<D> for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> Persist<D> for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
sourceimpl<FD, FS, D, T> Restore<D> for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> Restore<D> for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
sourceimpl<FD, FS, D, T> SparseAccess<FD, FS, D, T> for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> SparseAccess<FD, FS, D, T> for SparseTable<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
type Slice = SparseAccessor<FD, FS, D, T>
type Slice = SparseAccessor<FD, FS, D, T>
The type of a slice of this accessor
sourcefn accessor(self) -> SparseAccessor<FD, FS, D, T>
fn accessor(self) -> SparseAccessor<FD, FS, D, T>
Return this accessor as a SparseAccessor.
sourcefn 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
'a: 'async_trait,
Self: '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
'a: 'async_trait,
Self: 'async_trait,
Return this SparseTensor’s contents as an ordered stream of (Coord, [Number]) pairs.
sourcefn filled_at<'a, 'async_trait>(
self,
txn: T,
axes: Vec<usize>
) -> Pin<Box<dyn Future<Output = TCResult<TCBoxTryStream<'a, Coords>>> + Send + 'async_trait>>where
'a: 'async_trait,
Self: '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
'a: 'async_trait,
Self: 'async_trait,
sourcefn 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.
sourcefn 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.
sourceimpl<FD, FS, D, T> SparseWrite<FD, FS, D, T> for SparseTable<FD, FS, D, T>where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
<D::Write as DirWrite>::FileClass: From<BTreeType>,
<D::Read as DirRead>::FileEntry: AsType<FS>,
Self: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T> SparseWrite<FD, FS, D, T> for SparseTable<FD, FS, D, T>where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
<D::Write as DirWrite>::FileClass: From<BTreeType>,
<D::Read as DirRead>::FileEntry: AsType<FS>,
Self: SparseAccess<FD, FS, D, T>,
sourceimpl<FD, FS, D, T> TensorAccess for SparseTable<FD, FS, D, T>
impl<FD, FS, D, T> TensorAccess for SparseTable<FD, FS, D, T>
sourceimpl<FD, FS, D, T> Transact for SparseTable<FD, FS, D, T>where
FD: File<Array>,
FS: File<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<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
TableIndex<FS, D, T>: Transact,
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns true if self can be cast into the target type T.
sourceimpl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
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 Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
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.