Skip to main content

Module metadata

Module metadata 

Source
Expand description

The metadata chunk (SPEC.md, section 12): who made a file, how it may be used, and lasting ids for its parts, as entries of a subject, a key and a value.

Metadata never makes a file unreadable. Decoding drops what breaks a rule, entry by entry, or the whole payload when it is malformed; encoding refuses what a writer must not write.

entries   u32 count, then per entry:
          u32 the node index the entry is about, or FFFFFFFF for the file
          u32 length, key
          u32 length, value

Structs§

MetadataEntry
One entry of metadata.

Enums§

EncodeMetadataError
Why a list of metadata entries could not be encoded.

Constants§

METADATA_TAG
The tag of the metadata chunk.
METADATA_VERSION
The metadata payload layout this build writes and reads.
TEXT_KEYS
The registered keys whose value is UTF-8 text (SPEC.md, 12.1).
UUID_KEY
The registered key whose value is the 16 bytes of a UUID.

Functions§

decode_metadata
Decodes a metadata payload against scene, the scene of the same file. It never fails: a malformed payload is no metadata at all, and an entry that breaks a rule of section 12 is left out (SPEC.md, 12.2).
encode_metadata
Encodes entries as a metadata payload, in their order, checking them against scene.