Skip to main content

SessionControl

Trait SessionControl 

Source
pub trait SessionControl: Send + Sync {
    // Required methods
    fn begin<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn commit<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn rollback(&self) -> Result<(), IndexError>;
}
Expand description

Backend-implemented lifecycle control for session-scoped transactions.

Implementations manage the begin/commit/rollback lifecycle for atomic writes across all indexes during a single source-change processing. Session state lives inside backend implementations, shared via Arc.

Required Methods§

Source

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

Begin a new session-scoped transaction.

Source

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

Commit the current session-scoped transaction.

Source

fn rollback(&self) -> Result<(), IndexError>

Roll back the current session-scoped transaction.

This is synchronous to be safe for use in Drop implementations. Returns an error if the rollback itself fails (e.g., mutex poisoned).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§