feat: add ParseAs and NewSchema generics
Test / test (push) Successful in 1m38s

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-22 00:36:10 +02:00
parent b02471c09a
commit 71bd82a7a5
4 changed files with 73 additions and 0 deletions
+3
View File
@@ -46,6 +46,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(10000 levels, which no hand-written document approaches): a document that
nests arrays or inline tables deeper used to run the stack out and is now
rejected with a `SyntaxError` naming the limit.
- `ParseAs[T](data)`, the generic one-line decode, and `NewSchema[T]()`,
which precompiles the struct schema and the interface flags for a hot path
before the first document arrives.
- `OrderedMap`, the string-keyed table that remembers the order its keys were
set in: decoding into one fills it in the order the document wrote the
keys, and `Marshal` writes one back in that order, where a map carries no