pub struct TensorTransactions { /* private fields */ }Expand description
Owned, bounded callback program attached to one context.
Implementations§
Source§impl TensorTransactions
impl TensorTransactions
Sourcepub fn capture(
selectors: Vec<TensorSelector>,
) -> Result<Self, TensorTransactionError>
pub fn capture( selectors: Vec<TensorSelector>, ) -> Result<Self, TensorTransactionError>
Constructs a read-only capture program.
§Errors
Returns an error for empty, excessive, duplicate, unordered, mutable, or collectively over-bound selectors.
Sourcepub fn new(
selectors: Vec<TensorSelector>,
handler: impl TensorTransactionHandler + 'static,
) -> Result<Self, TensorTransactionError>
pub fn new( selectors: Vec<TensorSelector>, handler: impl TensorTransactionHandler + 'static, ) -> Result<Self, TensorTransactionError>
Constructs a capture/mutation program with one synchronous handler.
§Errors
Returns an error for empty, excessive, duplicate, unordered, or collectively over-bound selectors.
Sourcepub fn selectors(&self) -> &[TensorSelector]
pub fn selectors(&self) -> &[TensorSelector]
Returns exact selector contracts.
Sourcepub fn captures(&self) -> &[TransactionalTensorCapture]
pub fn captures(&self) -> &[TransactionalTensorCapture]
Returns successful retained tensors accumulated since the last drain.
A native speculative operation may perform several internal decodes. Each decode commits its retained tensors only after its lifecycle and selector coverage complete successfully.
Sourcepub fn take_captures(&mut self) -> Vec<TransactionalTensorCapture>
pub fn take_captures(&mut self) -> Vec<TransactionalTensorCapture>
Removes retained tensors accumulated since the previous drain.
Sourcepub const fn failure(&self) -> Option<&TensorCallbackFailure>
pub const fn failure(&self) -> Option<&TensorCallbackFailure>
Returns the contained failure from the most recent decode.