Skip to main content

CompactionHooks

Trait CompactionHooks 

Source
pub trait CompactionHooks: Send + Sync {
    // Provided methods
    fn before_compact(
        &self,
        _preparation: &CompactionPreparation,
        _custom_instructions: Option<&str>,
        _cancel: &CancellationToken,
    ) -> Pin<Box<dyn Future<Output = Result<BeforeCompactResult, CompactionError>> + Send + '_>> { ... }
    fn after_compact(
        &self,
        _result: &CompactionResult,
        _from_hook: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(), CompactionError>> + Send + '_>> { ... }
}
Expand description

Extension hook seam for compaction (default no-op; no pi-ext dependency).

Provided Methods§

Source

fn before_compact( &self, _preparation: &CompactionPreparation, _custom_instructions: Option<&str>, _cancel: &CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<BeforeCompactResult, CompactionError>> + Send + '_>>

Called after preparation, before summarization.

Source

fn after_compact( &self, _result: &CompactionResult, _from_hook: bool, ) -> Pin<Box<dyn Future<Output = Result<(), CompactionError>> + Send + '_>>

Called after a compaction result is produced (including hook replacement).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§