[][src]Struct lzzzz::lz4f::WriteDecompressor

pub struct WriteDecompressor<'a, W: Write> { /* fields omitted */ }

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]

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.

pub fn get_mut(&mut self) -> &mut W[src]

Returns a mutable reference to the writer.

pub fn get_ref(&self) -> &W[src]

Returns a shared reference to the writer.

pub fn into_inner(self) -> W[src]

Returns ownership of the writer.

Trait Implementations

impl<W, '_> Debug for WriteDecompressor<'_, W> where
    W: Write + Debug
[src]

impl<W: Write, '_> Write for WriteDecompressor<'_, W>[src]

Auto Trait Implementations

impl<'a, W> RefUnwindSafe for WriteDecompressor<'a, W> where
    W: RefUnwindSafe

impl<'a, W> Send for WriteDecompressor<'a, W> where
    W: Send

impl<'a, W> !Sync for WriteDecompressor<'a, W>

impl<'a, W> Unpin for WriteDecompressor<'a, W> where
    W: Unpin

impl<'a, W> UnwindSafe for WriteDecompressor<'a, W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.