pub struct Transaction { /* private fields */ }Expand description
Several writes committed as one durable record, or not at all.
The id is the transaction’s identity. Resubmitting the same transaction with the same id after
an uncertain outcome returns the original commit with duplicate: true; the same id with
different content is refused with IDEMPOTENCY_CONFLICT.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn generated() -> Self
pub fn generated() -> Self
A transaction with a fresh random identity. Keep Transaction::id if you may need to
resubmit it.
pub fn id(&self) -> &str
pub fn operation(self, operation: Operation) -> Self
pub fn precondition(self, precondition: Precondition) -> Self
Sourcepub fn fence(self, basis: ReadBasis) -> Self
pub fn fence(self, basis: ReadBasis) -> Self
Commit only if the state basis covers is unchanged since Client::read_basis captured it.
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§impl Debug for Transaction
impl Debug for Transaction
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
Source§impl Serialize for Transaction
impl Serialize for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more