Struct zstd::stream::zio::Writer [−][src]
pub struct Writer<W, D> { /* fields omitted */ }Implements the Write API around an Operation.
This can be used to wrap a raw in-memory operation in a write-focused API.
It can be used with either compression or decompression, and forwards the
output to a wrapped Write.
Implementations
impl<W, D> Writer<W, D> where
W: Write,
D: Operation, [src]
impl<W, D> Writer<W, D> where
W: Write,
D: Operation, [src]pub fn new(writer: W, operation: D) -> Self[src]
Creates a new Writer.
All output from the given operation will be forwarded to writer.
pub fn finish(&mut self) -> Result<()>[src]
Ends the stream.
This must be called after all data has been written to finish the stream.
If you forget to call this and just drop the Writer, you will have
an incomplete output.
Keep calling it until it returns Ok(()), then don’t call it again.
pub fn into_inner(self) -> (W, D)[src]
Return the wrapped Writer and Operation.
Careful: if you call this before calling Writer::finish(), the
output may be incomplete.
pub fn writer(&self) -> &W[src]
Gives a reference to the inner writer.
pub fn writer_mut(&mut self) -> &mut W[src]
Gives a mutable reference to the inner writer.
pub fn operation(&self) -> &D[src]
Gives a reference to the inner operation.
pub fn operation_mut(&mut self) -> &mut D[src]
Gives a mutable reference to the inner operation.
Trait Implementations
impl<W, D> Write for Writer<W, D> where
W: Write,
D: Operation, [src]
impl<W, D> Write for Writer<W, D> where
W: Write,
D: Operation, [src]fn write(&mut self, buf: &[u8]) -> Result<usize>[src]
fn flush(&mut self) -> Result<()>[src]
pub fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>1.36.0[src]
pub fn is_write_vectored(&self) -> bool[src]
pub fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>1.0.0[src]
pub fn write_all_vectored(
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>[src]
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
pub fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>1.0.0[src]
pub fn by_ref(&mut self) -> &mut Self1.0.0[src]
Auto Trait Implementations
impl<W, D> RefUnwindSafe for Writer<W, D> where
D: RefUnwindSafe,
W: RefUnwindSafe,
D: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, D> Send for Writer<W, D> where
D: Send,
W: Send,
D: Send,
W: Send,
impl<W, D> Sync for Writer<W, D> where
D: Sync,
W: Sync,
D: Sync,
W: Sync,
impl<W, D> Unpin for Writer<W, D> where
D: Unpin,
W: Unpin,
D: Unpin,
W: Unpin,
impl<W, D> UnwindSafe for Writer<W, D> where
D: UnwindSafe,
W: UnwindSafe,
D: UnwindSafe,
W: UnwindSafe,