Skip to main content

MessageRunnableCompactionExt

Trait MessageRunnableCompactionExt 

Source
pub trait MessageRunnableCompactionExt: Runnable<Vec<Message>, Message> + Sized {
    // Provided method
    fn with_compaction(
        self,
        compactor: Arc<dyn Compactor>,
        threshold_chars: usize,
    ) -> RunnableCompacting<Self> { ... }
}
Expand description

Extension trait that attaches RunnableCompacting to any Runnable<Vec<Message>, Message>. Blanket-impl’d for every such runnable so a model accepting messages — including layered models (OtelLayer, PolicyLayer, RetryService) — can chain .with_compaction(.) without a separate import per concrete type.

Provided Methods§

Source

fn with_compaction( self, compactor: Arc<dyn Compactor>, threshold_chars: usize, ) -> RunnableCompacting<Self>

Wrap with auto-compaction. The wrapper is itself a Runnable<Vec<Message>, Message>, so it composes back into any recipe that takes a model.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§