[][src]Struct lzzzz::lz4f::AsyncReadDecompressor

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

The AsyncRead-based streaming decompressor.

Example

use async_std::{fs::File, prelude::*};
use lzzzz::lz4f::AsyncReadDecompressor;

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

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

Implementations

impl<'a, R: AsyncRead + Unpin> AsyncReadDecompressor<'a, R>[src]

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

Creates a new AsyncReadDecompressor<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 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: AsyncRead + Unpin> AsyncRead for AsyncReadDecompressor<'a, R>[src]

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

impl<'a, R: AsyncRead + Unpin> PinnedDrop for AsyncReadDecompressor<'a, R>[src]

impl<'pin, 'a, R: AsyncRead + Unpin> Unpin for AsyncReadDecompressor<'a, R> where
    __AsyncReadDecompressor<'pin, 'a, R>: Unpin
[src]

impl<'a, R: AsyncRead + Unpin> UnsafeUnpin for AsyncReadDecompressor<'a, R>[src]

Auto Trait Implementations

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

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

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

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?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> 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.