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 event(&self, _ctx: &EventContext<'_>) -> Option<Box<dyn Event>> { ... }
}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 event(&self, _ctx: &EventContext<'_>) -> Option<Box<dyn Event>>
fn event(&self, _ctx: &EventContext<'_>) -> Option<Box<dyn Event>>
Builds an event for a framework lifecycle trigger.
The hook is called with the current procedure instance, so an event can
include state that was produced after the procedure was submitted. A
return value of None means that this trigger should not be recorded.
Events that share an [Event::event_type] must return identical
[Event::extra_schema] values. The event recorder batches events by type
and rejects incompatible schemas; use a distinct event type for a
different schema.