Expand description
Callable units, and how to describe and find them.
Every function, whether it came from Rust or from a script, is a
Function: a FunctionSignature describing it and a
FunctionBody doing the work. The body always has the same shape,
fn(&mut Context, &Registry), which is why the caller cannot tell the two
kinds apart.
§Argument order
A body pops its arguments in declaration order, first to last, and pushes
its results in reverse. A caller therefore has to push arguments in reverse
order. Function::call does that for you, Function::invoke does not.
Prefer call unless you already manage the stack yourself.
Structs§
- Function
- A callable unit: a signature plus a body.
- Function
Parameter - One input or output of a function, with its name and type.
- Function
Query - Search filter for functions in a
crate::registry::Registry. - Function
Query Parameter - Search filter for one function parameter.
- Function
Signature - Everything about a function except its body.
Enums§
- Function
Body - The code a function runs.
- Parameters
- Search filter for a function’s parameter list.
Type Aliases§
- Function
Handle - Shared function, as a registry holds it.
- Function
Meta Query - Predicate over a function’s metadata, used inside queries.