kiwi
Decoding of the Kiwi binary format, Evan Wallace’s
schema-based serialization (used by Figma’s .fig files, but generic).
A Kiwi message is meaningless without its schema. Schema::parse reads a binary schema
(the compiled form Kiwi writes, which .fig files embed), then Schema::decode decodes a
message against one of its definitions into a dynamic Value tree: objects, arrays, enums
by name and the usual scalars. Every failure on truncated or invalid data is a precise
KiwiError.
Built on bytes::ByteReader, plus Kiwi’s own 64-bit varints and
floats, which are not LEB128 and IEEE 754 on the wire.
Install
Section titled “Install”Cargo feature kiwi (enabled by default). To compile only this module:
or in Cargo.toml:
Import path: helpers4::kiwi.
| Item | What it does |
|---|---|
Definition | A named enum, struct or message of a Kiwi schema. |
Field | One field of a Definition. |
FieldType | The type of a Field: one of Kiwi’s built-in types, or another definition of the schema. |
Kind | What a Definition is: an enum, a struct (all its fields, in order) or a message (any of its fields, each with an id, ended by a 0). |
Schema | A Kiwi schema: the definitions (enums, structs and messages) that give meaning to the bytes of a message. |
Value | A decoded Kiwi value. |
Error types
Section titled “Error types”Documented on the page of the helper that returns them.
| Type | Returned by |
|---|---|
KiwiError | Schema |
