pub struct InstanceCap<O = Box<Cap>> {
pub image_hash_chain: CapHash,
pub image_hash: CapHash,
pub root_cnode: CapHashOrRef<O>,
pub mem: DataCap,
pub regs: [u64; 13],
pub pc: u64,
pub gas_remaining: u64,
}Fields§
§image_hash_chain: CapHashCumulative chain hash identifying the Instance’s type.
image_hash: CapHashHash of the Image cap currently bound. Always content- addressed (Images are immutable).
root_cnode: CapHashOrRef<O>Reference to the root cnode. Hash when clean / not yet
promoted for mutation; an inline Owned cnode cap while the
running kernel frame is mutating it.
mem: DataCapThe Instance’s read-write memory image: a dense DataCap covering the
data extent [DATA_BASE, DATA_BASE + mem.size). Holds the initial
content at boot and the settled (folded) content after each HALT — the
immutable backing half of the Backing+View mutability model. A
running engine wraps this in a transient CoW DataViewCap; at settle the
View folds back into a fresh DataCap that replaces this field. Pinned
(read-only) mappings are not stored here — they stay in their own
Cap::Data and are mapped RO separately, so the pinned-RO gas tier is
preserved.
regs: [u64; 13]PVM register file (φ[0]..φ[12]).
pc: u64Current PC. Zero between calls; updated to entry_pc at invoke start and to the post-execution PC on HALT.
gas_remaining: u64Gas left after the last call, for callers that want to observe residual gas. Set to 0 between calls in V1.
Implementations§
Source§impl<O> InstanceCap<O>
impl<O> InstanceCap<O>
Sourcepub fn mem_size(&self) -> u32
pub fn mem_size(&self) -> u32
Absolute exclusive top of the data region (DATA_BASE + mem.size). The
data extent [DATA_BASE, mem_size) is what the engines map; this matches
the legacy mem_size field’s semantics for call sites.
Sourcepub fn mem_extent(&self) -> u64
pub fn mem_extent(&self) -> u64
The data extent (RW memory size above DATA_BASE) in bytes — always a
PAGE_SIZE multiple.
Trait Implementations§
Source§impl<O> Archive for InstanceCap<O>
impl<O> Archive for InstanceCap<O>
Source§type Archived = ArchivedInstanceCap<O>
type Archived = ArchivedInstanceCap<O>
Source§type Resolver = InstanceCapResolver<O>
type Resolver = InstanceCapResolver<O>
Source§fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize. Read moreSource§impl<O: Clone> Clone for InstanceCap<O>
impl<O: Clone> Clone for InstanceCap<O>
Source§fn clone(&self) -> InstanceCap<O>
fn clone(&self) -> InstanceCap<O>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<O: Debug> Debug for InstanceCap<O>
impl<O: Debug> Debug for InstanceCap<O>
Source§impl<__D: Fallible + ?Sized, O> Deserialize<InstanceCap<O>, __D> for Archived<InstanceCap<O>>where
CapHash: Archive,
<CapHash as Archive>::Archived: Deserialize<CapHash, __D>,
CapHashOrRef<O>: Archive,
<CapHashOrRef<O> as Archive>::Archived: Deserialize<CapHashOrRef<O>, __D>,
DataCap: Archive,
<DataCap as Archive>::Archived: Deserialize<DataCap, __D>,
[u64; 13]: Archive,
<[u64; 13] as Archive>::Archived: Deserialize<[u64; 13], __D>,
u64: Archive,
<u64 as Archive>::Archived: Deserialize<u64, __D>,
impl<__D: Fallible + ?Sized, O> Deserialize<InstanceCap<O>, __D> for Archived<InstanceCap<O>>where
CapHash: Archive,
<CapHash as Archive>::Archived: Deserialize<CapHash, __D>,
CapHashOrRef<O>: Archive,
<CapHashOrRef<O> as Archive>::Archived: Deserialize<CapHashOrRef<O>, __D>,
DataCap: Archive,
<DataCap as Archive>::Archived: Deserialize<DataCap, __D>,
[u64; 13]: Archive,
<[u64; 13] as Archive>::Archived: Deserialize<[u64; 13], __D>,
u64: Archive,
<u64 as Archive>::Archived: Deserialize<u64, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<InstanceCap<O>, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<InstanceCap<O>, <__D as Fallible>::Error>
Source§impl<O> HashTreeRoot for InstanceCap<O>where
CapHashOrRef<O>: HashTreeRoot,
impl<O> HashTreeRoot for InstanceCap<O>where
CapHashOrRef<O>: HashTreeRoot,
Source§impl<__S: Fallible + ?Sized, O> Serialize<__S> for InstanceCap<O>
impl<__S: Fallible + ?Sized, O> Serialize<__S> for InstanceCap<O>
Auto Trait Implementations§
impl<O> Freeze for InstanceCap<O>where
O: Freeze,
impl<O> RefUnwindSafe for InstanceCap<O>where
O: RefUnwindSafe,
impl<O> Send for InstanceCap<O>where
O: Send,
impl<O> Sync for InstanceCap<O>where
O: Sync,
impl<O> Unpin for InstanceCap<O>where
O: Unpin,
impl<O> UnsafeUnpin for InstanceCap<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for InstanceCap<O>where
O: UnwindSafe,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read more