pub struct EfficientFileWriter { /* private fields */ }Expand description
Efficient file writer with buffering
Implementations§
Source§impl EfficientFileWriter
impl EfficientFileWriter
Sourcepub fn new<P: AsRef<Path>>(
path: P,
buffer_size: Option<usize>,
) -> UtilsResult<Self>
pub fn new<P: AsRef<Path>>( path: P, buffer_size: Option<usize>, ) -> UtilsResult<Self>
Create a new efficient file writer
Sourcepub fn append<P: AsRef<Path>>(
path: P,
buffer_size: Option<usize>,
) -> UtilsResult<Self>
pub fn append<P: AsRef<Path>>( path: P, buffer_size: Option<usize>, ) -> UtilsResult<Self>
Append to existing file
Sourcepub fn write_data(&mut self, data: &[u8]) -> UtilsResult<()>
pub fn write_data(&mut self, data: &[u8]) -> UtilsResult<()>
Write data with automatic flushing
Sourcepub fn write_lines<I>(&mut self, lines: I) -> UtilsResult<()>where
I: IntoIterator<Item = String>,
pub fn write_lines<I>(&mut self, lines: I) -> UtilsResult<()>where
I: IntoIterator<Item = String>,
Write string lines
Sourcepub fn write_array1(
&mut self,
array: &Array1<f64>,
delimiter: &str,
) -> UtilsResult<()>
pub fn write_array1( &mut self, array: &Array1<f64>, delimiter: &str, ) -> UtilsResult<()>
Write array data
Sourcepub fn write_array2(
&mut self,
array: &Array2<f64>,
delimiter: &str,
) -> UtilsResult<()>
pub fn write_array2( &mut self, array: &Array2<f64>, delimiter: &str, ) -> UtilsResult<()>
Write 2D array data
Sourcepub fn flush(&mut self) -> UtilsResult<()>
pub fn flush(&mut self) -> UtilsResult<()>
Flush the buffer
Auto Trait Implementations§
impl Freeze for EfficientFileWriter
impl RefUnwindSafe for EfficientFileWriter
impl Send for EfficientFileWriter
impl Sync for EfficientFileWriter
impl Unpin for EfficientFileWriter
impl UnwindSafe for EfficientFileWriter
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> 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