pub struct CompressionConfig { /* private fields */ }Expand description
A route’s compiled [route.compression] (ADR 000074): the offered codings in server-preference
order, the min-length floor, and the content-type allowlist (lower-cased at build so the
per-response check is an allocation-free case-insensitive scan over a short list).
Implementations§
Source§impl CompressionConfig
impl CompressionConfig
Sourcepub fn new(rc: &RouteCompression) -> Self
pub fn new(rc: &RouteCompression) -> Self
Compile a manifest [route.compression] block. Public because the fast-path server’s
negotiation unit tests build configs directly, without a manifest parse.
Sourcepub fn algorithms(&self) -> &[CompressionAlgorithm]
pub fn algorithms(&self) -> &[CompressionAlgorithm]
The codings this route offers, in server-preference order (the qvalue tie-break).
Sourcepub fn min_length(&self) -> u64
pub fn min_length(&self) -> u64
The declared-length floor: a response shorter than this is not worth a codec header.
Sourcepub fn content_type_eligible(&self, essence: &str) -> bool
pub fn content_type_eligible(&self, essence: &str) -> bool
Is this Content-Type essence (type/subtype, parameters already stripped) compressible
on this route? Case-insensitive scan — the list is ~a dozen entries, no per-request alloc.
Trait Implementations§
Auto 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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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>
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