pub struct InProcessKernelAssist { /* private fields */ }Expand description
In-process, in-memory KernelAssist impl. State lives in plain
HashMaps. Used by Stage 3’s tests and as a runnable default
before jar-kernel-v3 lands its σ-backed implementation.
Per spec §22, kernel-internal state is reset per block (the kernel
is stateless across blocks). This impl persists across Vm
invocations; the chain orchestrator that owns the Vm is
responsible for the block-boundary reset (see reset_block_state).
Implementations§
Source§impl InProcessKernelAssist
impl InProcessKernelAssist
pub fn new() -> Self
Sourcepub fn reset_block_state(&mut self)
pub fn reset_block_state(&mut self)
Reset all kernel-assisted state. The chain orchestrator calls this at block end per the v3 design (kernel is stateless across blocks).
Sourcepub fn register_file(&mut self, file_id: u64, data: CapHashOrRef)
pub fn register_file(&mut self, file_id: u64, data: CapHashOrRef)
Register a FileId → cache reference mapping. host_open of the
file_id returns the cache reference. Useful when seeding fixtures.
Trait Implementations§
Source§impl Debug for InProcessKernelAssist
impl Debug for InProcessKernelAssist
Source§impl Default for InProcessKernelAssist
impl Default for InProcessKernelAssist
Source§impl KernelAssist for InProcessKernelAssist
impl KernelAssist for InProcessKernelAssist
Source§fn gas_meter_get(&self, meter_id: MeterId) -> u64
fn gas_meter_get(&self, meter_id: MeterId) -> u64
Read the remaining gas for
meter_id. Missing entry → 0.Source§fn gas_meter_set(&mut self, meter_id: MeterId, value: u64) -> u64
fn gas_meter_set(&mut self, meter_id: MeterId, value: u64) -> u64
Atomically
GasMeter[meter_id] := value; return previous value
(or 0 if no entry existed).fn storage_quota_get(&self, quota_id: QuotaId) -> u64
fn storage_quota_set(&mut self, quota_id: QuotaId, value: u64) -> u64
Source§fn yield_catcher_markers(&self, catcher_hash: CapHash) -> Vec<CapHash> ⓘ
fn yield_catcher_markers(&self, catcher_hash: CapHash) -> Vec<CapHash> ⓘ
Read the marker list for a YieldCatcher instance identified by
catcher_hash. Order matters: routing walks the list and takes
the first match.Source§fn yield_catcher_add(
&mut self,
catcher_hash: CapHash,
marker_instance_hash: CapHash,
)
fn yield_catcher_add( &mut self, catcher_hash: CapHash, marker_instance_hash: CapHash, )
Add a marker template to the catcher’s list.
Source§fn yield_catcher_remove(
&mut self,
catcher_hash: CapHash,
marker_instance_hash: CapHash,
)
fn yield_catcher_remove( &mut self, catcher_hash: CapHash, marker_instance_hash: CapHash, )
Remove a marker template. No-op if absent.
Source§fn yield_catcher_new(&mut self) -> CapHash
fn yield_catcher_new(&mut self) -> CapHash
Mint a fresh empty YieldCatcher. Returns its content hash
(which the caller stores as a Cap::Instance[YieldCatcher]).
Auto Trait Implementations§
impl Freeze for InProcessKernelAssist
impl RefUnwindSafe for InProcessKernelAssist
impl Send for InProcessKernelAssist
impl Sync for InProcessKernelAssist
impl Unpin for InProcessKernelAssist
impl UnsafeUnpin for InProcessKernelAssist
impl UnwindSafe for InProcessKernelAssist
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.