pub enum Algorithm {
Gzip,
Deflate,
Brotli,
Identity,
}Expand description
One compression algorithm. The naming matches the HTTP
Content-Encoding registry value (lowercase, no padding).
Variants§
Gzip
gzip / RFC 1952. Universal compatibility.
Deflate
raw deflate / RFC 1951. RFC-permitted, irregular WAF support.
Brotli
brotli / RFC 7932. Wide WAF gap — the main attack vector.
Identity
no-op pass-through. Sometimes useful as a chain anchor when
the operator wants to mark “this body is encoded but the
outermost layer is identity” — RFC permits Content-Encoding: identity.
Implementations§
Source§impl Algorithm
impl Algorithm
Sourcepub fn content_encoding(self) -> &'static str
pub fn content_encoding(self) -> &'static str
The HTTP Content-Encoding token for this algorithm.
Sourcepub fn from_token(token: &str) -> Option<Self>
pub fn from_token(token: &str) -> Option<Self>
Parse a Content-Encoding token (case-insensitive) into the
matching algorithm. Returns None for unrecognised values.
Accepts the common alias x-gzip (RFC-permitted) for Gzip.
Trait Implementations§
impl Copy for Algorithm
impl Eq for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnsafeUnpin for Algorithm
impl UnwindSafe for Algorithm
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.