pub trait AsyncCompactionStrategy: Send + Sync {
// Required method
fn compact_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tokenizer: &'life2 dyn Tokenizer,
) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
}Expand description
The asynchronous form of CompactionStrategy, for strategies that
call out (summarization). Every CompactionStrategy is one.
Required Methods§
Sourcefn compact_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tokenizer: &'life2 dyn Tokenizer,
) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn compact_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tokenizer: &'life2 dyn Tokenizer,
) -> Pin<Box<dyn Future<Output = Vec<Message>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Return the retained messages after compaction.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".