[][src]Struct lzzzz::lz4f::AsyncWriteCompressor

pub struct AsyncWriteCompressor<W: AsyncWrite + Unpin> { /* fields omitted */ }
This is supported on feature="async-io" only.

The AsyncWrite-based stream compressor.

Example

use async_std::fs::File;
use futures_lite::*;
use lzzzz::lz4f::AsyncWriteCompressor;

let mut f = File::create("foo.lz4").await?;
let mut w = AsyncWriteCompressor::new(&mut f, Default::default())?;

w.write_all(b"Hello world!").await?;

// You have to call close() to finalize the frame.
w.close().await?;

Implementations

impl<W: AsyncWrite + Unpin> AsyncWriteCompressor<W>[src]

pub fn new(writer: W, prefs: Preferences) -> Result<Self>[src]

Creates a new AsyncWriteCompressor<W>.

pub fn with_dict(
    writer: W,
    prefs: Preferences,
    dict: Dictionary
) -> Result<Self>
[src]

Creates a new AsyncWriteCompressor<W> with a dictionary.

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: AsyncWrite + Unpin> AsyncWrite for AsyncWriteCompressor<W>[src]

impl<W> Debug for AsyncWriteCompressor<W> where
    W: AsyncWrite + Unpin + Debug
[src]

impl<W: AsyncWrite + Unpin> PinnedDrop for AsyncWriteCompressor<W>[src]

impl<'pin, W: AsyncWrite + Unpin> Unpin for AsyncWriteCompressor<W> where
    __AsyncWriteCompressor<'pin, W>: Unpin
[src]

impl<W: AsyncWrite + Unpin> UnsafeUnpin for AsyncWriteCompressor<W>[src]

Auto Trait Implementations

impl<W> RefUnwindSafe for AsyncWriteCompressor<W> where
    W: RefUnwindSafe

impl<W> Send for AsyncWriteCompressor<W> where
    W: Send

impl<W> !Sync for AsyncWriteCompressor<W>

impl<W> UnwindSafe for AsyncWriteCompressor<W> where
    W: UnwindSafe

Blanket Implementations

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

impl<R> AsyncWriteExt for R where
    R: AsyncWrite + ?Sized

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?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.

impl<T> WriteExt for T where
    T: AsyncWrite + ?Sized