pub trait NativeFn: Send + Sync {
// Required methods
fn call(&self, args: &[i64], pins: &[i64], depth: usize) -> NativeOutcome;
fn entry_ptr(&self) -> i64;
fn published_regc(&self) -> i64;
// Provided method
fn ret(&self) -> NativeRet { ... }
}Expand description
A natively-compiled function: integer registers in, integer result out.
depth is the LIVE LOGOS frame count at the call (the callee’s own frame
included) — native self-calls count against the same MAX_CALL_DEPTH the
bytecode enforces.
Required Methods§
Sourcefn call(&self, args: &[i64], pins: &[i64], depth: usize) -> NativeOutcome
fn call(&self, args: &[i64], pins: &[i64], depth: usize) -> NativeOutcome
args are the marshalled parameter slots (scalars by value, floats
as bits, list params as don’t-care placeholders); pins are the
pre-extracted [vec_handle, ptr, len] triples, one per list
parameter in declaration order, landing in the frame’s pin slots.
Sourcefn published_regc(&self) -> i64
fn published_regc(&self) -> i64
The regcount value to PUBLISH next to the entry pointer:
frame_size − 3, which the call stencil’s bound math and limit
planting are calibrated against (the plain register count for the
classic layout).