pub struct CsvHandler;Implementations§
Source§impl CsvHandler
impl CsvHandler
pub fn new() -> Self
pub fn read(&self, path: &str) -> Result<String>
pub fn write_from_csv(&self, input_path: &str, output_path: &str) -> Result<()>
pub fn write_records(&self, path: &str, records: Vec<Vec<String>>) -> Result<()>
Sourcepub fn read_range(
&self,
path: &str,
range: &CellRange,
) -> Result<Vec<Vec<String>>>
pub fn read_range( &self, path: &str, range: &CellRange, ) -> Result<Vec<Vec<String>>>
Read a specific range from CSV file
Sourcepub fn read_as_json(&self, path: &str) -> Result<String>
pub fn read_as_json(&self, path: &str) -> Result<String>
Read CSV and return as JSON array
Trait Implementations§
Source§impl DataReader for CsvHandler
impl DataReader for CsvHandler
Source§fn read_with_headers(&self, path: &str) -> Result<Vec<Vec<String>>>
fn read_with_headers(&self, path: &str) -> Result<Vec<Vec<String>>>
Read data with headers (first row contains column names)
Source§fn read_range(&self, path: &str, range: &CellRange) -> Result<Vec<Vec<String>>>
fn read_range(&self, path: &str, range: &CellRange) -> Result<Vec<Vec<String>>>
Read a specific cell range from a file
Source§fn supports_format(&self, path: &str) -> bool
fn supports_format(&self, path: &str) -> bool
Check if the file format is supported
Source§impl DataWriter for CsvHandler
impl DataWriter for CsvHandler
Source§fn write(
&self,
path: &str,
data: &[Vec<String>],
_options: DataWriteOptions,
) -> Result<()>
fn write( &self, path: &str, data: &[Vec<String>], _options: DataWriteOptions, ) -> Result<()>
Write data to a file
Source§fn write_range(
&self,
path: &str,
data: &[Vec<String>],
start_row: usize,
start_col: usize,
) -> Result<()>
fn write_range( &self, path: &str, data: &[Vec<String>], start_row: usize, start_col: usize, ) -> Result<()>
Write data to a specific cell range
Source§fn append(&self, path: &str, data: &[Vec<String>]) -> Result<()>
fn append(&self, path: &str, data: &[Vec<String>]) -> Result<()>
Append data to an existing file
Source§fn supports_format(&self, path: &str) -> bool
fn supports_format(&self, path: &str) -> bool
Check if the file format is supported
Source§impl FileHandler for CsvHandler
impl FileHandler for CsvHandler
Source§fn format_name(&self) -> &'static str
fn format_name(&self) -> &'static str
Get the format name (e.g., “csv”, “xlsx”, “parquet”)
Source§fn supported_extensions(&self) -> &'static [&'static str]
fn supported_extensions(&self) -> &'static [&'static str]
Get supported file extensions
Source§impl SchemaProvider for CsvHandler
impl SchemaProvider for CsvHandler
Auto Trait Implementations§
impl Freeze for CsvHandler
impl RefUnwindSafe for CsvHandler
impl Send for CsvHandler
impl Sync for CsvHandler
impl Unpin for CsvHandler
impl UnsafeUnpin for CsvHandler
impl UnwindSafe for CsvHandler
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