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§
Sourcefn begin<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.
Sourcefn commit<'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,
Commit the current session-scoped transaction.
Sourcefn rollback(&self) -> Result<(), IndexError>
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).