pub struct DynWriter<'a, W>(/* private fields */)
where
W: Write;Expand description
Type for runtime polymorphism over whether encoding uncompressed or Zstd-compressed
DBN records. Implements std::io::Write.
Implementations§
Source§impl<W> DynWriter<'_, W>where
W: Write,
impl<W> DynWriter<'_, W>where
W: Write,
Sourcepub fn new(writer: W, compression: Compression) -> Result<Self>
pub fn new(writer: W, compression: Compression) -> Result<Self>
Sourcepub fn with_compression_level(writer: W, level: i32) -> Result<Self>
pub fn with_compression_level(writer: W, level: i32) -> Result<Self>
Creates a new instance with zstd compression of the specified level.
§Errors
This function returns an error if it fails to initialize the Zstd encoder.
Trait Implementations§
Source§impl<W> Write for DynWriter<'_, W>where
W: Write,
impl<W> Write for DynWriter<'_, W>where
W: Write,
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>
Writes a formatted string into this writer, returning any error
encountered. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)Auto Trait Implementations§
impl<'a, W> Freeze for DynWriter<'a, W>where
W: Freeze,
impl<'a, W> !RefUnwindSafe for DynWriter<'a, W>
impl<'a, W> Send for DynWriter<'a, W>where
W: Send,
impl<'a, W> !Sync for DynWriter<'a, W>
impl<'a, W> Unpin for DynWriter<'a, W>where
W: Unpin,
impl<'a, W> !UnwindSafe for DynWriter<'a, W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more