Skip to main content

Crate opys_bundle

Crate opys_bundle 

Source
Expand description

The bundle: a manifest and the blobs it names, as one file.

It is a zip, and deliberately nothing more — unzip -l reads it:

opys.json        the head: the bundle's format, and its options
manifest.json    the manifest, whole
blobs/<sha256>   one entry per blob

The head is about the bundle and the manifest is about the installation, and the two are kept apart for that reason. The head is the first entry and is stored uncompressed, so what a bundle is can be read with one seek, or off the front of the file by something that never parses a zip at all. It says the format and the options a player may set; whatever else is worth knowing about a bundle without decoding megabytes of manifest goes there.

manifest.json is a Manifest as opys-core reads and writes it, and nothing else: the container adds no spelling of its own.

Structs§

Bundle
An open bundle: its manifest, decoded, and its blobs, still in the file.
Choice
One value a select offers, and what to call it.
Head
What a bundle says about itself, apart from the installation it carries.
Label
What every option says about itself to the person choosing.
Options
A bundle’s options, checked as a whole: a tree that has been read is one a form can be drawn from without looking at it twice.

Enums§

BlobSource
Where a blob’s bytes are before the manifest is published: a file on this machine, or bytes a plugin produced. This is build-machine state and is never part of a manifest — which is the whole difference from the file and bytes sources it replaces.
BundleError
OptionDef
One option. name is the variable it fills or, for a Feature, the feature it switches.

Constants§

BUNDLE_FORMAT
The format this reader and writer speak. A bundle that says anything else is refused before another byte of it is interpreted.

Functions§

blob_id
The id of the blob holding exactly bytes.
blob_id_of
The id and length of the blob holding what reader yields, without holding it in memory.
open_bundle
Open a bundle and decode its manifest. A manifest that names a blob the bundle does not hold is refused here, not halfway through an install.
read_bundle_head
Read a bundle’s head and nothing else. Costs the zip’s directory and a few bytes, whatever the bundle weighs.
write_bundle
Write manifest and the blobs it names as a bundle, under head.

Type Aliases§

Blobs
Blob id → where its bytes are. Ordered, because a bundle is written from it and must not differ between two builds of the same thing.