pub struct DefaultCompactor {
pub tokens_per_char: f32,
}Expand description
Heuristic compactor — operates on the structure of the context only.
Fields§
§tokens_per_char: f32Approximate tokens per char. 0.30 ≈ 3.3 chars/token (a generous English upper bound for non-Asian content).
Implementations§
Trait Implementations§
Source§impl Compactor for DefaultCompactor
impl Compactor for DefaultCompactor
fn budget(&self, ctx: &Context) -> Budget
fn compact<'life0, 'life1, 'async_trait>(
&'life0 self,
stage: CompactionStage,
ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<(), CompactError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for DefaultCompactor
impl RefUnwindSafe for DefaultCompactor
impl Send for DefaultCompactor
impl Sync for DefaultCompactor
impl Unpin for DefaultCompactor
impl UnsafeUnpin for DefaultCompactor
impl UnwindSafe for DefaultCompactor
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