pub enum CompressionLevel {
Off,
Lite,
Standard,
Max,
}Expand description
Unified compression level that replaces the 4 separate legacy concepts:
terse_agent, output_density, terse_mode, and crp_mode.
Each level maps to specific component settings via to_components().
Variants§
Implementations§
Source§impl CompressionLevel
impl CompressionLevel
Sourcepub fn to_components(&self) -> (TerseAgent, OutputDensity, &'static str, bool)
pub fn to_components(&self) -> (TerseAgent, OutputDensity, &'static str, bool)
Decomposes the unified level into legacy component settings. Returns (TerseAgent, OutputDensity, crp_mode_str, terse_mode_bool).
Sourcepub fn from_legacy(
terse_agent: &TerseAgent,
output_density: &OutputDensity,
) -> Self
pub fn from_legacy( terse_agent: &TerseAgent, output_density: &OutputDensity, ) -> Self
Infers a CompressionLevel from legacy config keys for backward compatibility.
Priority: terse_agent > output_density (picks the highest implied level).
Sourcepub fn from_env() -> Option<Self>
pub fn from_env() -> Option<Self>
Reads the compression level from the LEAN_CTX_COMPRESSION env var.
Sourcepub fn effective(config: &Config) -> Self
pub fn effective(config: &Config) -> Self
Returns the effective compression level with resolution order:
LEAN_CTX_COMPRESSIONenv varcompression_levelin config- Inferred from legacy
terse_agent+output_density
pub fn from_str_label(s: &str) -> Option<Self>
pub fn is_active(&self) -> bool
pub fn label(&self) -> &'static str
pub fn description(&self) -> &'static str
Trait Implementations§
Source§impl Clone for CompressionLevel
impl Clone for CompressionLevel
Source§fn clone(&self) -> CompressionLevel
fn clone(&self) -> CompressionLevel
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 moreSource§impl Debug for CompressionLevel
impl Debug for CompressionLevel
Source§impl Default for CompressionLevel
impl Default for CompressionLevel
Source§fn default() -> CompressionLevel
fn default() -> CompressionLevel
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CompressionLevel
impl<'de> Deserialize<'de> for CompressionLevel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CompressionLevel
impl PartialEq for CompressionLevel
Source§fn eq(&self, other: &CompressionLevel) -> bool
fn eq(&self, other: &CompressionLevel) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CompressionLevel
impl Serialize for CompressionLevel
impl StructuralPartialEq for CompressionLevel
Auto Trait Implementations§
impl Freeze for CompressionLevel
impl RefUnwindSafe for CompressionLevel
impl Send for CompressionLevel
impl Sync for CompressionLevel
impl Unpin for CompressionLevel
impl UnsafeUnpin for CompressionLevel
impl UnwindSafe for CompressionLevel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more