pub struct Synx;Expand description
Main entry point for the SYNX parser.
Implementations§
Source§impl Synx
impl Synx
Sourcepub fn parse(text: &str) -> HashMap<String, Value>
pub fn parse(text: &str) -> HashMap<String, Value>
Parse a SYNX string into a key-value map (static mode only).
Sourcepub fn parse_active(text: &str, opts: &Options) -> HashMap<String, Value>
pub fn parse_active(text: &str, opts: &Options) -> HashMap<String, Value>
Parse with full engine resolution (!active mode).
Sourcepub fn parse_full(text: &str) -> ParseResult
pub fn parse_full(text: &str) -> ParseResult
Parse and return full result including mode and metadata.
Sourcepub fn parse_tool(text: &str, opts: &Options) -> HashMap<String, Value>
pub fn parse_tool(text: &str, opts: &Options) -> HashMap<String, Value>
Parse a !tool call: returns { tool: "name", params: { ... } }.
If the text is also !active, markers (:env, :default, etc.)
are resolved before reshaping.
Sourcepub fn format(text: &str) -> String
pub fn format(text: &str) -> String
Reformat a .synx string into canonical form:
- Keys sorted alphabetically at every nesting level
- Exactly 2 spaces per indentation level
- One blank line between top-level blocks (objects / lists)
- Comments stripped — canonical form is comment-free
- Directive lines (
!active,!lock) preserved at the top
The same data always produces byte-for-byte identical output,
making .synx files deterministic and noise-free in git diff.
Sourcepub fn compile(text: &str, resolved: bool) -> Vec<u8> ⓘ
pub fn compile(text: &str, resolved: bool) -> Vec<u8> ⓘ
Compile a .synx string into compact binary .synxb format.
If resolved is true, active markers are resolved first (requires
!active mode) and metadata is stripped from the output.
Auto Trait Implementations§
impl Freeze for Synx
impl RefUnwindSafe for Synx
impl Send for Synx
impl Sync for Synx
impl Unpin for Synx
impl UnsafeUnpin for Synx
impl UnwindSafe for Synx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more