[−][src]Struct cloudflare_zlib::Deflate
Implementations
impl Deflate
[src]
Compress
pub fn new_default() -> Result<Self, ZError>
[src]
pub fn new(
level: c_int,
strategy: c_int,
window_bits: c_int
) -> Result<Self, ZError>
[src]
level: c_int,
strategy: c_int,
window_bits: c_int
) -> Result<Self, ZError>
Use zlib's magic constants:
- level =
Z_BEST_SPEED
(1) toZ_BEST_COMPRESSION
(9) - strategy =
Z_DEFAULT_STRATEGY
,Z_FILTERED
,Z_HUFFMAN_ONLY
,Z_RLE
,Z_FIXED
- window_bits = 15
pub fn new_with_vec(
level: c_int,
strategy: c_int,
window_bits: c_int,
buf: Vec<u8>
) -> Result<Self, ZError>
[src]
level: c_int,
strategy: c_int,
window_bits: c_int,
buf: Vec<u8>
) -> Result<Self, ZError>
Same as new, but can append to any Vec
pub fn reserve(&mut self, compressed_size: usize)
[src]
Expect (remaining) data to take this much space after compression
pub fn compress(&mut self, data: &[u8]) -> Result<(), ZError>
[src]
Add bytes from data
to compressed data
pub fn compress_with_limit(
&mut self,
data: &[u8],
max_size: &AtomicUsize
) -> Result<(), ZError>
[src]
&mut self,
data: &[u8],
max_size: &AtomicUsize
) -> Result<(), ZError>
dd bytes from data
to compressed data, unless the total compressed output would exceed max_size
pub fn finish(self) -> Result<Vec<u8>, ZError>
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Deflate
impl !Send for Deflate
impl !Sync for Deflate
impl Unpin for Deflate
impl UnwindSafe for Deflate
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,