pub struct CachedWriter<Storage>where
Storage: StorageWriteProvider,{ /* private fields */ }Expand description
Sequential cached writes with a generic storage provider with write access.
Implementations§
Source§impl<Storage> CachedWriter<Storage>where
Storage: StorageWriteProvider,
impl<Storage> CachedWriter<Storage>where
Storage: StorageWriteProvider,
pub fn new( filename: &str, cache_size: u64, writer: Storage::Writer, ) -> Result<Self>
pub fn flush(&mut self) -> Result<()>
pub fn get_file_size(&self) -> u64
Sourcepub fn write(&mut self, write_buf: &[u8]) -> Result<()>
pub fn write(&mut self, write_buf: &[u8]) -> Result<()>
Writes n_bytes from write_buf to the underlying cache
pub fn reset(&mut self) -> Result<()>
Trait Implementations§
Source§impl<Storage> Drop for CachedWriter<Storage>where
Storage: StorageWriteProvider,
impl<Storage> Drop for CachedWriter<Storage>where
Storage: StorageWriteProvider,
Auto Trait Implementations§
impl<Storage> Freeze for CachedWriter<Storage>
impl<Storage> RefUnwindSafe for CachedWriter<Storage>
impl<Storage> Send for CachedWriter<Storage>
impl<Storage> Sync for CachedWriter<Storage>
impl<Storage> Unpin for CachedWriter<Storage>
impl<Storage> UnwindSafe for CachedWriter<Storage>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more