pub struct TriggeredCompactionStrategy { /* private fields */ }Expand description
Runs a strategy only when its trigger fires (the trigger gating of upstream’s strategy base class).
Implementations§
Source§impl TriggeredCompactionStrategy
impl TriggeredCompactionStrategy
Sourcepub fn new(
trigger: Arc<dyn Fn(&CompactionMessageIndex) -> bool + Send + Sync>,
strategy: impl AsyncCompactionStrategy + 'static,
) -> TriggeredCompactionStrategy
pub fn new( trigger: Arc<dyn Fn(&CompactionMessageIndex) -> bool + Send + Sync>, strategy: impl AsyncCompactionStrategy + 'static, ) -> TriggeredCompactionStrategy
Run strategy when trigger fires.
Trait Implementations§
Source§impl AsyncCompactionStrategy for TriggeredCompactionStrategy
impl AsyncCompactionStrategy for TriggeredCompactionStrategy
Source§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,
TriggeredCompactionStrategy: '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,
TriggeredCompactionStrategy: 'async_trait,
Return the retained messages after compaction.
Source§impl Clone for TriggeredCompactionStrategy
impl Clone for TriggeredCompactionStrategy
Source§fn clone(&self) -> TriggeredCompactionStrategy
fn clone(&self) -> TriggeredCompactionStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TriggeredCompactionStrategy
impl !UnwindSafe for TriggeredCompactionStrategy
impl Freeze for TriggeredCompactionStrategy
impl Send for TriggeredCompactionStrategy
impl Sync for TriggeredCompactionStrategy
impl Unpin for TriggeredCompactionStrategy
impl UnsafeUnpin for TriggeredCompactionStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more