Expand description
ImageCap — Image cap.
Stores code, bitmask, jump_table, endpoints, mappings, and slot
references as separate Vec<T> allocations. Allocation count
per ImageCap is bounded (seven Vecs, regardless of content size);
we accept that in exchange for direct field accessors.
Structs§
- Endpoint
Def - Endpoint definition. Dense
initial_regsarray; indexicorresponds to PVM registerφ[i].0is “use default” (same semantics as the spec’s oldBTreeMap<u8, u64>when the key is absent). - Image
Cap - Image
Slot Entry (slot_idx, cap_hash)pair used by Image’spinnedandinitialarrays. References content-addressed caps only.- Memory
Mapping - One mapped region. The kernel resolves
source_pathat instance start, reads the bytes from the resultingCap::Data, and lays them at[start, start + size).source_pathis a fixed-cap array;source_path_lenis the actual depth.
Enums§
- Image
Convert Error - Failure modes when converting a SCALE-encoded
crate::image::Imageinto anImageCap. The conversion is lossy in fields the v3 cap shape no longer carries (gas_slots,quota_slots, per-endpointarg_registers) and constrained in others — these errors flag the constraint violations.
Functions§
- image_
cap - Build an
ImageCapfrom the SCALE-encodedcrate::image::Imageshape. The Data content referenced by pinned and initial slots must already be published — pass the resolved(SlotIdx, CapHash)pairs inpinned_hashesandinitial_hashes. The builder sorts both lists by slot index.