[−][src]Struct lzzzz::lz4f::WriteDecompressor
The Write
-based streaming decompressor.
Example
use lzzzz::lz4f::{compress_to_vec, WriteDecompressor}; use std::{fs::File, io::prelude::*}; let mut f = File::create("foo.txt")?; let mut w = WriteDecompressor::new(&mut f)?; let mut buf = Vec::new(); compress_to_vec(b"Hello world!", &mut buf, &Default::default())?; w.write_all(&buf)?;
Implementations
impl<'a, W: Write> WriteDecompressor<'a, W>
[src]
pub fn new(writer: W) -> Result<Self>
[src]
Creates a new WriteDecompressor<W>
.
pub fn set_dict<D>(&mut self, dict: D) where
D: Into<Cow<'a, [u8]>>,
[src]
D: Into<Cow<'a, [u8]>>,
Sets the dictionary.
pub fn frame_info(&self) -> Option<FrameInfo>
[src]
Returns FrameInfo
if the frame header is already decoded.
Otherwise, returns None
.
pub fn decode_header_only(&mut self, flag: bool)
[src]
Sets the 'header-only' mode.
When the 'header-only' mode is enabled, the decompressor doesn't
consume the frame body and write()
always returns Ok(0)
if the frame header is already decoded.
Trait Implementations
impl<W: Write, '_> Write for WriteDecompressor<'_, W>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
fn is_write_vectored(&self) -> bool
[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice]) -> Result<(), Error>
[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl<'a, W> RefUnwindSafe for WriteDecompressor<'a, W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<'a, W> Send for WriteDecompressor<'a, W> where
W: Send,
W: Send,
impl<'a, W> !Sync for WriteDecompressor<'a, W>
impl<'a, W> Unpin for WriteDecompressor<'a, W> where
W: Unpin,
W: Unpin,
impl<'a, W> UnwindSafe for WriteDecompressor<'a, W> where
W: UnwindSafe,
W: UnwindSafe,
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>,