pub struct CompressionConfig {
pub budget: usize,
pub current_tokens: usize,
pub fidelity: FidelityLevel,
}Expand description
Context provided when running the compressor.
Fields§
§budget: usizeMaximum allowed token count.
current_tokens: usizeTokens consumed so far (approximate).
fidelity: FidelityLevelSemantic preservation level.
Implementations§
Source§impl CompressionConfig
impl CompressionConfig
Sourcepub fn usage_ratio(&self) -> f64
pub fn usage_ratio(&self) -> f64
Current budget usage ratio (0.0–1.0).
Sourcepub fn stage(&self) -> CompressionStage
pub fn stage(&self) -> CompressionStage
Returns the compression stage for the current usage ratio.
Sourcepub fn min_stage(&self) -> CompressionStage
pub fn min_stage(&self) -> CompressionStage
Returns the minimum compression stage enforced by the fidelity level, regardless of budget usage ratio.
Compressed: always applies at leastPruneLowImportance- Others: no minimum (budget ratio decides)
Trait Implementations§
Source§impl Clone for CompressionConfig
impl Clone for CompressionConfig
Source§fn clone(&self) -> CompressionConfig
fn clone(&self) -> CompressionConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for CompressionConfig
impl RefUnwindSafe for CompressionConfig
impl Send for CompressionConfig
impl Sync for CompressionConfig
impl Unpin for CompressionConfig
impl UnsafeUnpin for CompressionConfig
impl UnwindSafe for CompressionConfig
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