csv_cat/lib.rs
1//! # csv-cat
2//!
3//! CSV processing built on [`comp-cat-rs`](https://crates.io/crates/comp-cat-rs).
4//!
5//! All operations return `Io<CsvError, _>` for composable effect handling.
6//! File handles are managed via `Resource`. Rows stream as `Stream<CsvError, Row>`.
7//!
8//! ## Quick start
9//!
10//! ```rust,ignore
11//! use csv_cat::{reader, writer, row::Row, error::CsvError};
12//!
13//! // Read all rows from a file
14//! let rows = reader::read_all("data.csv", reader::ReaderConfig::new()).run()?;
15//!
16//! // Process rows
17//! let names: Vec<String> = rows.iter()
18//! .filter_map(|row| row.get(0).ok().map(String::from))
19//! .collect();
20//!
21//! // Read from a string
22//! let rows = reader::from_str("a,b\n1,2\n", reader::ReaderConfig::new()).run()?;
23//!
24//! // Write to a string
25//! let output = writer::to_string(
26//! writer::WriterConfig::new(),
27//! Some(vec!["name".into(), "age".into()]),
28//! rows,
29//! ).run()?;
30//! ```
31
32pub mod error;
33pub mod row;
34pub mod reader;
35pub mod writer;