Skip to main content

StateBackendCore

Trait StateBackendCore 

Source
pub trait StateBackendCore: Send + Sync {
    // Required methods
    fn upsert_invocation<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        invocation: &'life1 InvocationDTO,
        call: &'life2 CallDTO,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_invocation<'life0, 'life1, 'async_trait>(
        &'life0 self,
        invocation_id: &'life1 InvocationId,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<InvocationDTO>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_call<'life0, 'life1, 'async_trait>(
        &'life0 self,
        call_id: &'life1 CallId,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<CallDTO>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn store_result<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        invocation_id: &'life1 InvocationId,
        result: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_result<'life0, 'life1, 'async_trait>(
        &'life0 self,
        invocation_id: &'life1 InvocationId,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn store_error<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        invocation_id: &'life1 InvocationId,
        error: &'life2 TaskError,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_error<'life0, 'life1, 'async_trait>(
        &'life0 self,
        invocation_id: &'life1 InvocationId,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<Option<TaskError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_history<'life0, 'life1, 'async_trait>(
        &'life0 self,
        history: &'life1 InvocationHistory,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_history<'life0, 'life1, 'async_trait>(
        &'life0 self,
        invocation_id: &'life1 InvocationId,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<Vec<InvocationHistory>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn purge<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn backend_name(&self) -> &'static str { ... }
    fn usage_stats<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<(&'static str, String)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Core state persistence — invocation storage, results, history, and cleanup.

All methods in this sub-trait are required (no defaults).

Required Methods§

Source

fn upsert_invocation<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, invocation: &'life1 InvocationDTO, call: &'life2 CallDTO, ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store or update an invocation and its associated call.

Source

fn get_invocation<'life0, 'life1, 'async_trait>( &'life0 self, invocation_id: &'life1 InvocationId, ) -> Pin<Box<dyn Future<Output = RustvelloResult<InvocationDTO>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve an invocation by ID.

Source

fn get_call<'life0, 'life1, 'async_trait>( &'life0 self, call_id: &'life1 CallId, ) -> Pin<Box<dyn Future<Output = RustvelloResult<CallDTO>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve a call by ID.

Source

fn store_result<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, invocation_id: &'life1 InvocationId, result: &'life2 str, ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store the result of a successful invocation.

Source

fn get_result<'life0, 'life1, 'async_trait>( &'life0 self, invocation_id: &'life1 InvocationId, ) -> Pin<Box<dyn Future<Output = RustvelloResult<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve the result of a completed invocation.

Source

fn store_error<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, invocation_id: &'life1 InvocationId, error: &'life2 TaskError, ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store error information for a failed invocation.

Source

fn get_error<'life0, 'life1, 'async_trait>( &'life0 self, invocation_id: &'life1 InvocationId, ) -> Pin<Box<dyn Future<Output = RustvelloResult<Option<TaskError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve error information for a failed invocation.

Source

fn add_history<'life0, 'life1, 'async_trait>( &'life0 self, history: &'life1 InvocationHistory, ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record a status change in the audit log.

Source

fn get_history<'life0, 'life1, 'async_trait>( &'life0 self, invocation_id: &'life1 InvocationId, ) -> Pin<Box<dyn Future<Output = RustvelloResult<Vec<InvocationHistory>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the full status history for an invocation.

Source

fn purge<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RustvelloResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Purge all stored data.

Provided Methods§

Source

fn backend_name(&self) -> &'static str

Human-readable name of this backend implementation.

Source

fn usage_stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<(&'static str, String)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Key-value statistics about this backend’s current state.

Implementors§