Repository navigation
Highlights
- Strict ron-rs compatibility. The parser is a port of ron-rs 0.12.3 value parsing and is checked in CI against ron-rs itself (about 1,300 corpus documents plus differential fuzzing).
- Faster decoding.
Unmarshaldecodes straight from the text without an intermediate tree: on par withencoding/json, andParseis about twice as fast asencoding/jsonintoany.Formatis faster too. - Comment preserving edits.
ParseEditablewithGet,Set,SetRON,Delete,InsertandAppendby path. - Field naming.
NamingStrategy(camelCase, PascalCase, ...),SetFieldNaming, and a per-structrename_all=option. - Pretty printing.
PrettyConfigandMarshalWithConfig, modelled on ron-rs'sPrettyConfig. - Raw values and generics.
rustyon.Raw,UnmarshalAs[T],DecodeAs[T]. - Enum representations. Internally tagged, adjacently tagged and untagged enums via
RegisterEnumWith, plus aflattentag option. - Options structs.
EncodeOptions/MarshalWithandDecodeOptions/UnmarshalWith. - Composite
Valuetypes print as compact RON withfmt.
Behaviour changes
These follow from matching ron-rs exactly:
- Nesting is limited like ron-rs: 64 nested collections, 128 nested
Some(. - Unsuffixed integers beyond 128 bits become floats instead of an error.
- Ranges (
1..2,1..=2,..) and#![type = "..."]/#![schema = "..."]attributes are accepted. isize/usizesuffixes,0X/0O/0Bprefixes and the\b,\f,\/escapes are rejected.( )is an empty tuple and()is unit.- On a decode error the target may be partially modified;
UnmarshalRON/UnmarshalTexthooks run at most once per value. - Decoding a non-comparable key into
map[any]Treturns an error instead of panicking.
CLI
The CLI is now its own module with its own tags; see the cmd/rustyon/v1.1.0 release for binaries:
go install github.com/peltonapp/rustyon-go/cmd/rustyon@latest