pub trait Procedure: Send {
    // Required methods
    fn type_name(&self) -> &str;
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        ctx: &'life1 Context,
    ) -> Pin<Box<dyn Future<Output = Result<Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn dump(&self) -> Result<String>;
    fn lock_key(&self) -> LockKey;
    // Provided methods
    fn rollback<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _: &'life1 Context,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn rollback_supported(&self) -> bool { ... }
    fn recover(&mut self) -> Result<()> { ... }
    fn poison_keys(&self) -> PoisonKeys { ... }
    fn user_metadata(&self) -> Option<UserMetadata> { ... }
}Expand description
A Procedure represents an operation or a set of operations to be performed step-by-step.
Required Methods§
Provided Methods§
Sourcefn rollback<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    _: &'life1 Context,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn rollback<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    _: &'life1 Context,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Rollback the failed procedure.
The implementation must be idempotent.
Sourcefn rollback_supported(&self) -> bool
 
fn rollback_supported(&self) -> bool
Indicates whether it supports rolling back the procedure.
Sourcefn poison_keys(&self) -> PoisonKeys
 
fn poison_keys(&self) -> PoisonKeys
Returns the PoisonKeys that may cause this procedure to become poisoned during execution.
Sourcefn user_metadata(&self) -> Option<UserMetadata>
 
fn user_metadata(&self) -> Option<UserMetadata>
Returns the user metadata of the procedure. If the metadata contains the eventable object, you can use UserMetadata::to_event to get the event and emit it to the event recorder.