Skip to main content

Module image

Module image 

Source
Expand description

ImageCap — Image cap.

Stores a single code region, endpoints, mappings, and slot references as separate Vec<T> allocations. Allocation count per ImageCap is bounded regardless of content size; we accept that in exchange for direct field accessors.

Structs§

ArchivedEndpointDef
An archived EndpointDef
ArchivedImageCap
An archived ImageCap
ArchivedImageSlotEntry
An archived ImageSlotEntry
ArchivedMemoryMapping
An archived MemoryMapping
EndpointDef
Endpoint definition. Dense initial_regs array; index i corresponds to PVM register φ[i]. 0 is “use default” (same semantics as the spec’s old BTreeMap<u8, u64> when the key is absent).
EndpointDefResolver
The resolver for an archived EndpointDef
ImageCap
Validation model: structure is eager, semantics are lazy
ImageCapResolver
The resolver for an archived ImageCap
ImageSlotEntry
(slot_key, cap_hash) pair used by Image’s pinned and initial arrays. References content-addressed caps only.
ImageSlotEntryResolver
The resolver for an archived ImageSlotEntry
MemoryMapping
One mapped region. The kernel resolves source (a SlotPath to a Cap::Data) at instance start, reads the bytes, and lays them at [start, start + size).
MemoryMappingResolver
The resolver for an archived MemoryMapping

Enums§

ImageConvertError
Failure modes when converting an SSZ-encoded crate::image::Image into an ImageCap. The conversion preserves the slots and metadata that remain cap-resident, drops only per-endpoint arg_registers, and is constrained in others — these errors flag the constraint violations.

Functions§

image_cap
Build an ImageCap from the SSZ-encoded crate::image::Image shape. The Data content referenced by pinned and initial slots must already be published — pass the resolved (SlotIdx, CapHash) pairs in pinned_hashes and initial_hashes. The builder sorts both lists by slot index.