Skip to main content

Module native_fn

Module native_fn 

Source
Expand description

Native function interface exposed to host code.

Hosts implement RelonFunction and register the resulting function under a path name via Context::register_fn. The evaluator passes a NativeArgs bundle that pre-splits positional and named arguments so implementations can validate either view without re-parsing.

NativeFn is a re-export alias of dyn RelonFunction so call sites that want a shorter spelling can write NativeFn instead of the longer trait-object form. The two names refer to the same trait.

Structs§

EvaluatedArg
A single evaluated argument from a Relon call site, preserving its name if it was passed as name=value.
NativeArgs
Argument bundle handed to a RelonFunction. Positional and named arguments are split apart up front so each host function only inspects what it cares about.

Traits§

NativeFnCaps
A handle to the evaluator’s internal execution capabilities, allowing native functions to call back into Relon logic (closures).
RelonFunction
Host-implemented native function. Registered into a crate::Context via Context::register_fn / register_pure_fn.

Type Aliases§

NativeFn
Convenience alias for the dyn RelonFunction trait object. Hosts that store native fns by trait object can write Arc<dyn NativeFn> instead of Arc<dyn RelonFunction> — the two are interchangeable.