Expand description
CSV parser and serializer using facet-format.
Note: CSV is a fundamentally different format from JSON/XML/YAML. While those formats are tree-structured and map naturally to nested types, CSV is a flat, row-based format where each row represents a single record and each column represents a field.
This crate provides basic CSV support via the FormatParser trait, but
has significant limitations:
- No support for nested structures (CSV is inherently flat)
- No support for arrays/sequences as field values
- No support for enums beyond unit variants (encoded as strings)
- All values are strings and must be parseable to target types
For more sophisticated CSV handling, consider a dedicated CSV library.
Structs§
- CsvError
- Error type for CSV parsing.
- CsvParser
- CSV parser that emits FormatParser events.
- CsvSerialize
Error - Error type for CSV serialization.
- CsvSerializer
- CSV serializer implementing FormatSerializer.
Enums§
- CsvError
Kind - Specific kinds of CSV errors.
- Deserialize
Error - Error produced by the format deserializer.
Functions§
- from_
slice - Deserialize a value from CSV bytes into an owned type.
- from_
slice_ borrowed - Deserialize a value from CSV bytes, allowing zero-copy borrowing.
- from_
str - Deserialize a value from a CSV string into an owned type.
- from_
str_ borrowed - Deserialize a value from a CSV string, allowing zero-copy borrowing.
- to_
string - Serialize a value to a CSV string.
- to_vec
- Serialize a value to CSV bytes.
- to_
writer - Serialize a value to a writer in CSV format.