Expand description
Wire-form caps for the host ↔ guest put_cap RPC.
Cap and its inner types use the SSZ derive macro for content
hashing and carry rkyv-incompatible fields (SparseList in
CNodeCap, Arc<PageBytes> in PageSlot::Loaded). Adding
rkyv derives there would either require hand-written Archive /
Serialize / Deserialize impls for those types or a
transformation wrapper. We pick a third option: a sibling enum
whose shape mirrors Cap but flattens or omits the unsupported
fields, with explicit From<&Cap> / TryInto<Cap> conversions
at the wire boundary.
§V0 limitations
WireCap::CNodeonly carries materializedHashslot entries.SparseListcached-subtree-roots andMissingOr::Missing(_)placeholders are dropped on the wire; the receiver reconstructs a freshCNodeCapwithout them.Ref(_)slot targets are rejected (WireConvertError::CapHasRef) because the receiver has no way to resolve them in its ownCapRefnamespace.WireCap::Dataonly supportsDataContent::Inline. ThePagedvariant errors out (WireConvertError::PagedData) —PageRef = Arc<PageBytes>doesn’t archive cleanly and the V0 bench guests don’t need it.WireCap::Instanceonly carriesHashroot_cnode(no liveReftargets, same reasoning as CNode).
These limits cover the smoke-test path (Image + empty CNode + Instance with no rw_overlays containing Refs) and are tightened at the type level: the wire types simply don’t have fields for the unsupported shapes.
Structs§
- Archived
WireC Node Cap - An archived
WireCNodeCap - Archived
WireC Node Slot - An archived
WireCNodeSlot - Archived
Wire Data Cap - An archived
WireDataCap - Archived
Wire Endpoint Def - An archived
WireEndpointDef - Archived
Wire Image Cap - An archived
WireImageCap - Archived
Wire Image Slot Entry - An archived
WireImageSlotEntry - Archived
Wire Instance Cap - An archived
WireInstanceCap - Archived
Wire Memory Mapping - An archived
WireMemoryMapping - Archived
Wire RwOverlay - An archived
WireRwOverlay - Archived
Wire Type Cap - An archived
WireTypeCap - WireC
Node Cap - Wire form of
CNodeCap. Flat list of(slot, hash)pairs; only materializedHashslot entries are carried. - WireC
Node CapResolver - The resolver for an archived
WireCNodeCap - WireC
Node Slot - WireC
Node Slot Resolver - The resolver for an archived
WireCNodeSlot - Wire
Data Cap - Wire form of
DataCap. V0: inline-only. - Wire
Data CapResolver - The resolver for an archived
WireDataCap - Wire
Endpoint Def - Wire
Endpoint DefResolver - The resolver for an archived
WireEndpointDef - Wire
Image Cap - Wire form of
ImageCap. Direct field-for-field mirror — all inner types are derive-compatible already. - Wire
Image CapResolver - The resolver for an archived
WireImageCap - Wire
Image Slot Entry - Wire
Image Slot Entry Resolver - The resolver for an archived
WireImageSlotEntry - Wire
Instance Cap - Wire form of
InstanceCap.root_cnodecollapsesCapHashOrRefdown to a plain hash (V0: refs unsupported). - Wire
Instance CapResolver - The resolver for an archived
WireInstanceCap - Wire
Memory Mapping - Wire
Memory Mapping Resolver - The resolver for an archived
WireMemoryMapping - Wire
RwOverlay - Wire
RwOverlay Resolver - The resolver for an archived
WireRwOverlay - Wire
Type Cap - Wire
Type CapResolver - The resolver for an archived
WireTypeCap
Enums§
- Archived
Wire Cap - An archived
WireCap - WireCap
- Wire-shaped cap. Derives
rkyv::{Archive, Serialize, Deserialize}using onlyalloc::Vec/Boxand plainrepr(C)fields. The shape mirrorsCapbut with the constraints called out in the module docs. - Wire
CapResolver - The resolver for an archived
WireCap - Wire
Convert Error - Failures the wire-form conversion can produce. All non-fatal: they indicate the cap shape isn’t supported on the V0 RPC path.
Functions§
- box_
from_ wire - Box-ed convenience: produce a
Box<Cap>from an archivedWireCap. Used by the guest’sput_capRPC handler to deposit the decoded cap into its directory.