[][src]Struct lzzzz::lz4f::AsyncBufReadDecompressor

pub struct AsyncBufReadDecompressor<'a, R: AsyncBufRead + Unpin> { /* fields omitted */ }
This is supported on feature="async-io" only.

The AsyncBufRead-based streaming decompressor.

Example

use async_std::{fs::File, io::BufReader, prelude::*};
use lzzzz::lz4f::AsyncBufReadDecompressor;

let mut f = File::open("foo.lz4").await?;
let mut b = BufReader::new(f);
let mut r = AsyncBufReadDecompressor::new(&mut b)?;

let mut buf = Vec::new();
r.read_frame_info().await?;
r.read_to_end(&mut buf).await?;

Implementations

impl<'a, R: AsyncBufRead + Unpin> AsyncBufReadDecompressor<'a, R>[src]

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

Creates a new AsyncBufReadDecompressor<R>.

pub fn set_dict<D>(&mut self, dict: D) where
    D: Into<Cow<'a, [u8]>>, 
[src]

Sets the dictionary.

pub async fn read_frame_info<'_>(&'_ mut self) -> Result<FrameInfo>[src]

Reads the frame header asynchronously and returns FrameInfo.

Calling this function before any AsyncRead or AsyncBufRead operations does not consume the frame body.

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

Returns a mutable reference to the reader.

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

Returns a shared reference to the reader.

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

Returns ownership of the reader.

Trait Implementations

impl<'a, R: AsyncBufRead + Unpin> AsyncBufRead for AsyncBufReadDecompressor<'a, R>[src]

impl<'a, R: AsyncBufRead + Unpin> AsyncRead for AsyncBufReadDecompressor<'a, R>[src]

impl<R, '_> Debug for AsyncBufReadDecompressor<'_, R> where
    R: AsyncBufRead + Unpin + Debug
[src]

impl<'a, R: AsyncBufRead + Unpin> PinnedDrop for AsyncBufReadDecompressor<'a, R>[src]

impl<'pin, 'a, R: AsyncBufRead + Unpin> Unpin for AsyncBufReadDecompressor<'a, R> where
    __AsyncBufReadDecompressor<'pin, 'a, R>: Unpin
[src]

impl<'a, R: AsyncBufRead + Unpin> UnsafeUnpin for AsyncBufReadDecompressor<'a, R>[src]

Auto Trait Implementations

impl<'a, R> RefUnwindSafe for AsyncBufReadDecompressor<'a, R> where
    R: RefUnwindSafe

impl<'a, R> Send for AsyncBufReadDecompressor<'a, R> where
    R: Send

impl<'a, R> !Sync for AsyncBufReadDecompressor<'a, R>

impl<'a, R> UnwindSafe for AsyncBufReadDecompressor<'a, R> where
    R: UnwindSafe

Blanket Implementations

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

impl<R> AsyncBufReadExt for R where
    R: AsyncBufRead + ?Sized

impl<R> AsyncBufReadExt for R where
    R: AsyncBufRead + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

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

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

impl<T> BufReadExt for T where
    T: AsyncBufRead + ?Sized

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

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

impl<T> ReadExt for T where
    T: AsyncRead + ?Sized

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.