pub struct EfficientFileReader { /* private fields */ }Expand description
Efficient file reader with buffering and memory management
Implementations§
Source§impl EfficientFileReader
impl EfficientFileReader
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 reader
Sourcepub fn read_lines(&mut self) -> impl Iterator<Item = UtilsResult<String>> + '_
pub fn read_lines(&mut self) -> impl Iterator<Item = UtilsResult<String>> + '_
Read lines efficiently with iterator
Sourcepub fn read_chunk(&mut self, size: usize) -> UtilsResult<Vec<u8>>
pub fn read_chunk(&mut self, size: usize) -> UtilsResult<Vec<u8>>
Read fixed-size chunks
Sourcepub fn read_all(&mut self) -> UtilsResult<Vec<u8>>
pub fn read_all(&mut self) -> UtilsResult<Vec<u8>>
Read all content efficiently
Sourcepub fn read_array1(&mut self, delimiter: &str) -> UtilsResult<Array1<f64>>
pub fn read_array1(&mut self, delimiter: &str) -> UtilsResult<Array1<f64>>
Read numerical data as arrays
Sourcepub fn read_array2(&mut self, delimiter: &str) -> UtilsResult<Array2<f64>>
pub fn read_array2(&mut self, delimiter: &str) -> UtilsResult<Array2<f64>>
Read 2D numerical data
Auto Trait Implementations§
impl Freeze for EfficientFileReader
impl RefUnwindSafe for EfficientFileReader
impl Send for EfficientFileReader
impl Sync for EfficientFileReader
impl Unpin for EfficientFileReader
impl UnwindSafe for EfficientFileReader
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