Expand description
Renderers for the tabnas transducer protocols.
A renderer decides how a semantic protocol becomes text: TableRows/1
becomes CSV, JsonEvents/1 becomes JSON, incrementally, through a
coalescing writer with a byte budget. Source interpretation never
crosses into this crate: a renderer sees labels and cells, never paths.
text:TextOut, the fragment boundary every renderer writes to;WriteOut, which coalesces fragments to a byte budget, enforcesmax_output_bytesand countsoutput_bytes;StringOutfor tests and small results;JoinandReplaceText, the two text combinators whose correctness depends on chunk boundaries, andConcat, aJoinwith no separator under the name the language gives it.csv:CsvRenderer, the always-quoted profile ofTableRows/1, withCsvOptionsfor the dialects.json:JsonRenderer,JsonEvents/1as compact or indented JSON text.records:RecordsToJson,TableRows/1asJsonEvents/1, an array of objects keyed by label.number: the JSON number grammar both renderers hold lexemes to.
Every renderer validates its protocol as it goes and reports the
stable codes of tabnas_transduce::Code; the output is flushed once,
at the protocol’s end, and a failure found after text was written says
so with committed_output.
Re-exports§
pub use csv::CsvOptions;pub use csv::CsvRenderer;pub use csv::MissingText;pub use csv::Newline;pub use csv::Quoting;pub use json::JsonOptions;pub use json::JsonRenderer;pub use number::is_json_number;pub use records::MissingRecord;pub use records::RecordsToJson;pub use text::Concat;pub use text::Join;pub use text::ReplaceText;pub use text::StringOut;pub use text::TextOut;pub use text::WriteOut;pub use text::DEFAULT_BUDGET;
Modules§
- csv
TableRows/1as CSV: the always-quoted profile.- json
JsonEvents/1as JSON text.- number
- Number text, shared by the renderers.
- records
TableRows/1asJsonEvents/1: an array of records keyed by label.- text
- Text output: where rendered fragments go.
Constants§
- VERSION
- This crate’s version, as
Cargo.tomldeclares it.