pub struct ExecutionContext<T, E>where
E: Display,{ /* private fields */ }Expand description
Execution context (state after task execution)
This type provides result retrieval functionality after task execution.
Prepare lifecycle callbacks are configured on
super::DoubleCheckedLockExecutor and are already applied before an
ExecutionContext is returned. Task closures are responsible for their own
rollback, cleanup, and commit logic.
§Type Parameters
T- The type of the task return valueE- The type of the task error
Implementations§
Source§impl<T, E> ExecutionContext<T, E>where
E: Display,
impl<T, E> ExecutionContext<T, E>where
E: Display,
Sourcepub fn get_result(self) -> ExecutionResult<T, E>
pub fn get_result(self) -> ExecutionResult<T, E>
Gets the execution result (consumes the context)
Prepare commit or rollback callbacks have already been executed by the builder before this context was created. This method does not trigger additional side effects.
§Returns
The owned ExecutionResult stored in this context.
Sourcepub fn peek_result(&self) -> &ExecutionResult<T, E>
pub fn peek_result(&self) -> &ExecutionResult<T, E>
Checks the execution result (does not consume the context)
§Returns
A shared reference to the stored ExecutionResult.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Source§impl<E> ExecutionContext<(), E>where
E: Display,
impl<E> ExecutionContext<(), E>where
E: Display,
Sourcepub fn finish(self) -> bool
pub fn finish(self) -> bool
Completes execution (for operations without return values)
Returns whether the execution was successful
§Returns
true if the stored result is ExecutionResult::Success containing
().