Expand description
Native functions written as plain Rust closures over Values.
function builds a PHP function whose arguments arrive converted (objects and closures as Value::Opaque) and
whose result or NativeError goes back to PHP. raw_function builds one that gets its arguments unconverted
(Args): it converts only what it reads and passes the rest through as the zvals PHP gave it, for functions on
a hot path. Every one runs through the same dispatcher, which finds the handler by the called function (by name
the first time, then by the function itself) and goes through boundary::native_entry, so bailouts and panics
never cross Rust frames. An area uses them from crate::NativeArea::functions.
Structs§
- Args
- The arguments of a
raw_functioncall, as PHP passed them. Each accessor reads one argument; nothing is converted unless asked for.
Enums§
- Native
Error - How a native function fails in PHP.
Functions§
- function
- A PHP function
name(namespaced names allowed) that takes any arguments and runshandler. - raw_
function - A PHP function
namethat takes any arguments and runshandlerover them unconverted. What it returns goes back to PHP; a value it passed through (Args::pass) goes back as the very same zval.
Type Aliases§
- Handler
- A native function’s body: the arguments it was given, converted.
- RawHandler
- A native function’s body that reads its arguments itself (
Args).