Separate syntax from interpretation

Flyology CBOR owns RFC 8949 byte syntax, exact offsets, event grammar, checked scalar conversion, profiles, lifecycle, and syntax diagnostics. Consumers retain their logical model and policy.

Expose syntax without a data model

The crate does not own optional, variant, record, or map envelopes. It does not own application paths, duplicate policy, logical budgets, construction, or error translation. Tags remain raw syntax and cannot create schema identity.

Retain fixed parser state

Parser stores a syntax stack sized by the caller. It also stores fixed nine-byte and four-byte buffers for incomplete CBOR heads and UTF-8 scalars. It stores no input pointer, container, heap object, or finalizer.

Arrays, maps, tags, and indefinite strings consume syntax frames. Definite map lengths count pairs, while the grammar enforces twice that many child items. Tags close after one nested item.

Keep the targetless engine private

The private writer engine stores grammar, profile, and lifecycle state without a destination reference. The public self-owned facades embed both engine and staging. During one active transaction, the generic facade passes the same caller target synchronously to every destination operation.

Text validation spans every supplied fragment. Ordinary_Compact output selects shortest heads where documented, preserves requested float width and caller order, and makes no canonical-output claim.

Make storage and work explicit

The parser and bounded writer allocate no heap storage. Syntax-stack storage is proportional to the selected depth. Parser work is linear in admitted bytes plus events. Writer validation is linear in supplied text bytes plus synchronous destination work.

Separate staging from publication

Destination writes retain unpublished bytes. Successful commit is the only publication point. Failure, explicit abort, or scope exit cannot publish a prefix. A mutation-time Storage_Error enters Failed, leaves staging ineligible, and is re-raised. A Storage_Error while copying Output leaves the writer Completed, so the caller can retry the copy.