pub struct Nub { /* private fields */ }Expand description
Uniform handle to the JAVM engine — a newtype over the generic
nub::Nub substrate handle with the JAVM-typed publish surface.
Implementations§
Source§impl Nub
impl Nub
Sourcepub fn hyperlight() -> Result<HyperlightNubGuard>
pub fn hyperlight() -> Result<HyperlightNubGuard>
Borrow the process-wide Hyperlight-backed Nub loaded from the
javm-guest-x86 production guest blob.
pub fn hyperlight_with_options( options: NubOptions, ) -> Result<HyperlightNubGuard>
Sourcepub fn put_cap(&self, cap: &Cap) -> Result<AbiCapHash>
pub fn put_cap(&self, cap: &Cap) -> Result<AbiCapHash>
Put a caller-built javm_cap::Cap into the active cache.
Computes the cap’s content hash and either clones the cap on
first put or bumps refcount on idempotent re-put. Returns the
cap’s content hash.
Sourcepub fn put_cap_with_hash(&self, hash: AbiCapHash, cap: &Cap) -> Result<()>
pub fn put_cap_with_hash(&self, hash: AbiCapHash, cap: &Cap) -> Result<()>
Pre-hashed variant. Caller computed ssz::hash_tree_root(cap)
at warmup and passes it explicitly; on the hot idempotent path
this lets both backends skip the SSZ merkleize entirely.
Debug-asserts the claimed hash matches the cap; release trusts
the caller.
Hyperlight backend: short-circuits on a host-side set of blob
hashes this sandbox has already published — the typical bench /
replay workload re-publishes the same cap graph every iteration
and pays only one host-side HashSet::contains, with the rkyv
encode never running (see nub::Nub::put_object_with_hash).
Sourcepub fn invoke_cached(
&self,
root: AbiCapHash,
endpoint_idx: u8,
args: [u64; 4],
initial_gas: u64,
) -> Result<InvocationResult>
pub fn invoke_cached( &self, root: AbiCapHash, endpoint_idx: u8, args: [u64; 4], initial_gas: u64, ) -> Result<InvocationResult>
Invoke a previously-published Cap::Instance by hash. V0 args
are 4 u64s laid into φ[7..=10] on top of the published
endpoint’s initial_regs baseline.
Sourcepub fn submit_invoke(&self, request: InvokeRequest) -> Result<InvokeJob>
pub fn submit_invoke(&self, request: InvokeRequest) -> Result<InvokeJob>
Submit an invocation and return an async job handle.
Sourcepub fn evict_jit_all(&self) -> Result<()>
pub fn evict_jit_all(&self) -> Result<()>
Bench-only: clear the guest’s JIT compile cache so the next
invoke_cached pays a full recompile. No-op on the Local
backend.
Sourcepub fn state_root(&self) -> CapHash
pub fn state_root(&self) -> CapHash
Current state root.