Skip to main content

Arch

Trait Arch 

Source
pub trait Arch {
    type Error;

    // Required methods
    fn invoke(
        &mut self,
        target: InstanceRef,
        endpoint: u16,
        args: &[u8],
        opts: InvokeOptions,
    ) -> Result<InvokeOutcome, Self::Error>;
    fn state_root(&self) -> CapHash;
}
Expand description

Low-level CPU/MMU substrate trait. An Arch impl runs in the same address space as the Kernel that calls it — it owns the kernel’s state and provides the primitives (page mapping, ring transitions, exception handling, …) needed to execute JAVM programs. The skeleton trait only exposes invoke and state_root; the substrate-specific primitives that the kernel will eventually drive (map_pages, install_handler, …) are intentionally not part of the public surface yet — they’re encapsulated inside Arch::invoke for now.

Required Associated Types§

Required Methods§

Source

fn invoke( &mut self, target: InstanceRef, endpoint: u16, args: &[u8], opts: InvokeOptions, ) -> Result<InvokeOutcome, Self::Error>

Invoke endpoint on the Cap::Instance identified by target, passing args (SCALE-encoded, by convention). The Arch impl is responsible for executing the underlying JAVM program to termination (HALT / yield / fault / gas-exhausted) and reporting the outcome.

Source

fn state_root(&self) -> CapHash

Content-addressed root of the Arch’s current state — the hash of the invoking Cap::Instance after the most recent invocation (or genesis if none).

Implementors§