Macro define_direct_function
Source macro_rules! define_direct_function {
($name:ident, args: [], $body:expr) => { ... };
($name:ident, args: [$arg_type:ty], $body:expr) => { ... };
($name:ident, args: [$arg_type1:ty, $arg_type2:ty], $body:expr) => { ... };
($name:ident, args: [$arg_type1:ty, $arg_type2:ty, $arg_type3:ty], $body:expr) => { ... };
($name:ident, args: [$arg_type1:ty, $arg_type2:ty, $arg_type3:ty, $arg_type4:ty], $body:expr) => { ... };
}
Expand description
Define a function that returns a direct value.
Expands to a FunctionHandler that:
- Validates argument count (0–4).
- Converts
Value arguments to the specified Rust types.
- Converts the returned value into
Value via
convert_result_to_value.