pub struct LoopOp<T> { /* private fields */ }Expand description
Loop operation that executes a batch of operations repeatedly until a limit is reached
Implementations§
Source§impl<T> LoopOp<T>where
T: Send + 'static,
impl<T> LoopOp<T>where
T: Send + 'static,
Sourcepub fn new(counter_var: String, limit: usize, ops: Vec<Arc<dyn Op<T>>>) -> Self
pub fn new(counter_var: String, limit: usize, ops: Vec<Arc<dyn Op<T>>>) -> Self
Create a new loop operation
§Arguments
counter_var- Name of the counter variable to store in contextlimit- Maximum number of iterations to performops- Vector of operations to execute in each iteration
Sourcepub fn with_continue_on_error(self, continue_on_error: bool) -> Self
pub fn with_continue_on_error(self, continue_on_error: bool) -> Self
Set whether to continue on error
Trait Implementations§
Source§impl<T> Op<Vec<T>> for LoopOp<T>where
T: Send + 'static,
impl<T> Op<Vec<T>> for LoopOp<T>where
T: Send + 'static,
fn perform<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
dry: &'life1 mut DryContext,
wet: &'life2 mut WetContext,
) -> Pin<Box<dyn Future<Output = OpResult<Vec<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn metadata(&self) -> OpMetadata
Source§fn rollback<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_dry: &'life1 mut DryContext,
_wet: &'life2 mut WetContext,
) -> Pin<Box<dyn Future<Output = OpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rollback<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_dry: &'life1 mut DryContext,
_wet: &'life2 mut WetContext,
) -> Pin<Box<dyn Future<Output = OpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Optional rollback method for ops that need custom cleanup logic.
Default implementation is a no-op for backward compatibility.
Called automatically by batch operations when a later op fails.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for LoopOp<T>
impl<T> !UnwindSafe for LoopOp<T>
impl<T> Freeze for LoopOp<T>
impl<T> Send for LoopOp<T>
impl<T> Sync for LoopOp<T>
impl<T> Unpin for LoopOp<T>
impl<T> UnsafeUnpin for LoopOp<T>
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