Skip to main content

Crate synx_core

Crate synx_core 

Source
Expand description

§SYNX Core — The Active Data Format

High-performance SYNX parser with full !active engine support. Single Rust crate powering all language bindings.

use synx_core::{Synx, Value};

let data = Synx::parse("name Wario\nage 30\nactive true");
assert_eq!(data["name"], Value::String("Wario".into()));
assert_eq!(data["age"], Value::Int(30));

Re-exports§

pub use schema_json::metadata_to_json_schema;
pub use schema_json::value_to_json_value;
pub use synxl::parse_lines;
pub use synxl::parse_lines_with;
pub use synxl::records_to_json_array;
pub use synxl::records_to_ndjson;
pub use synxl::write_document;
pub use synxl::write_lines;
pub use synxl::Diagnostic;
pub use synxl::DiagnosticKind;
pub use synxl::FieldDecl;
pub use synxl::FieldList;
pub use synxl::SynxlDocument;
pub use synxl::SynxlError;
pub use synxl::SynxlErrorKind;
pub use synxl::SynxlOptions;
pub use synxl::SynxlReader;
pub use synxl::SynxlReaderOwned;
pub use synxl::SynxlRecord;
pub use synxl::SynxlStreamError;
pub use synxl::SynxlStreamReader;
pub use diff::diff as diff_objects;
pub use diff::DiffResult;
pub use diff::DiffChange;
pub use diff::diff_to_value;

Modules§

binary
SYNX Binary Format (.synxb) — compact binary serialization with string interning.
diff
Structural diff between two SYNX values.
schema_json
Build JSON Schema from !active Constraints and validate Value instances (optional jsonschema feature).
synxl
SYNXL — “SYNX Lines”: the record-stream counterpart of JSONL and CSV.

Structs§

Constraints
Constraints from [min:3, max:30, required, type:int].
IncludeDirective
Include directive: !include path [alias]
Meta
Metadata for a single key (markers, args, constraints).
Options
Options for active mode resolution.
ParseResult
Full parse result with metadata.
ParserOptions
Options for a single parse_with run.
Synx
Main entry point for the SYNX parser.
UseDirective
Use directive: !use @scope/name [as alias]

Enums§

Mode
File mode.
Value
SYNX value types.

Functions§

parse
Parse a SYNX text string into a value tree with metadata.
parse_with
Parse a SYNX text string with explicit ParserOptions.
reshape_tool_output
Reshape parsed tree for !tool mode.
resolve
Resolve all active-mode markers in a ParseResult. Returns the resolved root Value.
safe_calc
Safely evaluate an arithmetic expression. All variable references must be substituted with numbers before calling this.
to_json
Convert a Value to a JSON string.
write_json
Write a Value as JSON string (for FFI output).

Type Aliases§

MetaMap
Map of key → metadata for one object level.