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 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).

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.
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.
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.