Skip to main content

Op

Trait Op 

Source
pub trait Op<T>: Send + Sync {
    // Required methods
    fn perform<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        dry: &'life1 mut DryContext,
        wet: &'life2 mut WetContext,
    ) -> Pin<Box<dyn Future<Output = OpResult<T>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn metadata(&self) -> OpMetadata;

    // Provided method
    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 { ... }
}

Required Methods§

Source

fn perform<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dry: &'life1 mut DryContext, wet: &'life2 mut WetContext, ) -> Pin<Box<dyn Future<Output = OpResult<T>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn metadata(&self) -> OpMetadata

Provided Methods§

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,

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Op<bool> for InlinePredicateOp

Source§

impl Op<bool> for TrivialPredicate

Source§

impl<T> Op<()> for T
where T: Trigger,

Source§

impl<T> Op<T> for LoggingWrapper<T>
where T: Send + 'static,

Source§

impl<T> Op<T> for TimeBoundWrapper<T>
where T: Send + 'static,

Source§

impl<T> Op<T> for ValidatingWrapper<T>
where T: Send + Sync + 'static + Serialize,

Source§

impl<T> Op<Vec<T>> for BatchOp<T>
where T: Send + Sync + 'static,

Source§

impl<T> Op<Vec<T>> for LoopOp<T>
where T: Send + 'static,