[][src]Struct lzzzz::lz4::Decompressor

pub struct Decompressor<'a> { /* fields omitted */ }

Streaming LZ4 decompressor.

Example

use lzzzz::lz4;

const ORIGINAL_SIZE: usize = 44;
const COMPRESSED_DATA: &str =
    "8B1UaGUgcXVpY2sgYnJvd24gZm94IGp1bXBzIG92ZXIgdGhlIGxhenkgZG9nLg==";

let data = base64::decode(COMPRESSED_DATA).unwrap();

let mut decomp = lz4::Decompressor::new()?;
let result = decomp.next(&data[..], ORIGINAL_SIZE)?;

assert_eq!(result, &b"The quick brown fox jumps over the lazy dog."[..]);

Implementations

impl<'a> Decompressor<'a>[src]

pub fn new() -> Result<Self>[src]

Creates a new Decompressor.

pub fn with_dict<D>(dict: D) -> Result<Self> where
    D: Into<Cow<'a, [u8]>>, 
[src]

Creates a new Decompressor with a dictionary.

pub fn next(&mut self, src: &[u8], original_size: usize) -> Result<&[u8]>[src]

Decompresses a LZ4 block.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Decompressor<'a>

impl<'a> Send for Decompressor<'a>

impl<'a> !Sync for Decompressor<'a>

impl<'a> Unpin for Decompressor<'a>

impl<'a> UnwindSafe for Decompressor<'a>

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.