pub struct BrotliCodec {
pub quality: u32,
pub window_size: u32,
}Expand description
Brotli codec
Fields§
§quality: u32Compression quality (0-11)
window_size: u32Window size (10-24)
Implementations§
Source§impl BrotliCodec
impl BrotliCodec
Sourcepub fn with_quality(quality: u32) -> Self
pub fn with_quality(quality: u32) -> Self
Create codec with custom quality
Sourcepub fn compress(&self, content: &str) -> Result<CompressionResult>
pub fn compress(&self, content: &str) -> Result<CompressionResult>
Compress string to wire format: #M2M[v3.0]|DATA:<base64>
Sourcepub fn decompress(&self, wire: &str) -> Result<String>
pub fn decompress(&self, wire: &str) -> Result<String>
Decompress from wire format
Trait Implementations§
Source§impl Clone for BrotliCodec
impl Clone for BrotliCodec
Source§fn clone(&self) -> BrotliCodec
fn clone(&self) -> BrotliCodec
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 BrotliCodec
impl RefUnwindSafe for BrotliCodec
impl Send for BrotliCodec
impl Sync for BrotliCodec
impl Unpin for BrotliCodec
impl UnwindSafe for BrotliCodec
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