pub struct Transaction { /* private fields */ }Expand description
An atomic builder restricted to the database’s default domain.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn put<Record: IrohRecord>(&mut self, record: Record) -> Result<(), DbError>
pub fn put<Record: IrohRecord>(&mut self, record: Record) -> Result<(), DbError>
Adds a typed record replacement to this transaction.
Sourcepub fn delete<Record: IrohRecord>(
&mut self,
id: &Record::Id,
) -> Result<(), DbError>
pub fn delete<Record: IrohRecord>( &mut self, id: &Record::Id, ) -> Result<(), DbError>
Adds a typed record deletion to this transaction.
Sourcepub async fn commit(self) -> Result<ChangeBatch, DbError>
pub async fn commit(self) -> Result<ChangeBatch, DbError>
Creates one encrypted commit and publishes every prepared record atomically.
Auto Trait Implementations§
impl Freeze for Transaction
impl !RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more