pub struct UncommittedResult<DbTransaction> { /* private fields */ }
Expand description
The uncommitted result of transactions execution with database transaction. The caller should commit the result by itself.
Implementations§
Source§impl<DbTransaction> UncommittedResult<DbTransaction>
impl<DbTransaction> UncommittedResult<DbTransaction>
Sourcepub fn new(result: ExecutionResult, database_transaction: DbTransaction) -> Self
pub fn new(result: ExecutionResult, database_transaction: DbTransaction) -> Self
Create a new instance of UncommittedResult
.
Sourcepub fn result(&self) -> &ExecutionResult
pub fn result(&self) -> &ExecutionResult
Returns a reference to the ExecutionResult
.
Sourcepub fn into(self) -> (ExecutionResult, DbTransaction)
pub fn into(self) -> (ExecutionResult, DbTransaction)
Return the result and database transaction.
The service can unpack the UncommittedResult
, apply some changes and pack it again into
UncommittedResult
. Because commit
of the database transaction consumes self
,
after committing it is not possible create UncommittedResult
.
Sourcepub fn into_result(self) -> ExecutionResult
pub fn into_result(self) -> ExecutionResult
Discards the database transaction and returns only the result of execution.
Sourcepub fn into_transaction(self) -> DbTransaction
pub fn into_transaction(self) -> DbTransaction
Discards the result and return database transaction.
Trait Implementations§
Auto Trait Implementations§
impl<DbTransaction> Freeze for UncommittedResult<DbTransaction>where
DbTransaction: Freeze,
impl<DbTransaction> !RefUnwindSafe for UncommittedResult<DbTransaction>
impl<DbTransaction> Send for UncommittedResult<DbTransaction>where
DbTransaction: Send,
impl<DbTransaction> Sync for UncommittedResult<DbTransaction>where
DbTransaction: Sync,
impl<DbTransaction> Unpin for UncommittedResult<DbTransaction>where
DbTransaction: Unpin,
impl<DbTransaction> !UnwindSafe for UncommittedResult<DbTransaction>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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