pub enum AdaptiveStorageWriter<F, V>where
F: StorageWriter,
V: StorageWriter,{
Bounded(BoundedStorageWriter<F>),
Fixed(F),
Variable(V),
}
Expand description
Writer that adaptively uses either fixed-length or variable-length storage
The storage type used depends on the stream characteristics:
Bounded
: For infinite streams, using fixed-length storage with size limitsFixed
: For finite streams smaller than or equal to the buffer sizeVariable
: For finite streams larger than the buffer size
Variants§
Bounded(BoundedStorageWriter<F>)
Used for infinite streams, wrapping the fixed-length storage in a bounded buffer
Fixed(F)
Used for finite streams smaller than or equal to the buffer size
Variable(V)
Used for finite streams larger than the buffer size
Trait Implementations§
Source§impl<F, V> Debug for AdaptiveStorageWriter<F, V>
impl<F, V> Debug for AdaptiveStorageWriter<F, V>
Source§impl<F, V> Seek for AdaptiveStorageWriter<F, V>where
F: StorageWriter,
V: StorageWriter,
impl<F, V> Seek for AdaptiveStorageWriter<F, V>where
F: StorageWriter,
V: StorageWriter,
Source§fn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · Source§fn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
Source§fn stream_len(&mut self) -> Result<u64, Error>
fn stream_len(&mut self) -> Result<u64, Error>
🔬This is a nightly-only experimental API. (
seek_stream_len
)Returns the length of this stream (in bytes). Read more
Source§impl<F, V> Write for AdaptiveStorageWriter<F, V>where
F: StorageWriter,
V: StorageWriter,
impl<F, V> Write for AdaptiveStorageWriter<F, V>where
F: StorageWriter,
V: StorageWriter,
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 is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl<F, V> Freeze for AdaptiveStorageWriter<F, V>
impl<F, V> RefUnwindSafe for AdaptiveStorageWriter<F, V>where
F: RefUnwindSafe,
V: RefUnwindSafe,
impl<F, V> Send for AdaptiveStorageWriter<F, V>
impl<F, V> Sync for AdaptiveStorageWriter<F, V>
impl<F, V> Unpin for AdaptiveStorageWriter<F, V>
impl<F, V> UnwindSafe for AdaptiveStorageWriter<F, V>where
F: UnwindSafe,
V: UnwindSafe,
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