Skip to main content

Crate facet_csv

Crate facet_csv 

Source
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.
CsvSerializeError
Error type for CSV serialization.
CsvSerializer
CSV serializer implementing FormatSerializer.

Enums§

CsvErrorKind
Specific kinds of CSV errors.
DeserializeError
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.