Skip to main content

sif_parser/
lib.rs

1// sif-parser — Structured Interchange Format parser.
2//
3// A spec-driven SIF v1 implementation with zero external dependencies.
4//
5// Covers:
6// - SIF Core v1 — parse, emit, stream, types, schemas, blocks, templates,
7//   inline annotations, CDC, sections, references
8// - SIF Streaming Protocol — stream lifecycle, multiplexing, CDC mode,
9//   schema evolution, flow control, heartbeat, status
10// - Format conversion — JSON, JSONL, CSV ↔ SIF
11// - Type inference, schema inference, semantic inference
12//
13// Reference: Structured Interchange Format (SIF) v1.0
14//            SIF Streaming Protocol v1.0
15
16pub mod error;
17pub mod types;
18pub mod infer;
19pub mod streaming;
20pub mod packed;
21
22mod parse;
23mod reader;
24mod emit;
25
26// Re-export the public API at the crate root.
27
28pub use error::{Error, ErrorKind, Pos};
29
30pub use types::{
31    Block, BlockType, CdcOp, Directive, Document, Event, FieldDef, FieldRef, Header, Modifier,
32    Record, Schema, Section, SortDirection, Span, Template, Type, Value,
33};
34
35pub use parse::{
36    parse, parse_inline_annotations, parse_inline_sif, parse_schema, parse_type_str,
37    parse_typed_value, parse_untyped_value,
38};
39
40pub use reader::{reader_stdin, Reader};
41
42pub use emit::{emit_to_string, Emitter};
43
44pub use infer::{
45    from_csv, from_json, from_jsonl,
46    to_csv, to_json_array, to_jsonl,
47    infer_schema, infer_schema_owned, infer_type, merge_types,
48    sanitize_field_name,
49};
50
51pub use streaming::{
52    StatusLevel, StreamEvent, StreamInfo, StreamMode, StreamReader,
53};