macro_rules! define_implicit_function {
($name:ident, args: [$arg_type0:path], $body:expr) => { ... };
($name:ident, args: [$arg_type0:path, $arg_type1:path], $body:expr) => { ... };
($name:ident, args: [$arg_type0:path, $arg_type1:path, $arg_type2:path], $body:expr) => { ... };
($name:ident, args: [$arg_type0:path, $arg_type1:path, $arg_type2:path, $arg_type3:path], $body:expr) => { ... };
}Expand description
Macro for defining implicit functions that work with specific value types.
This macro provides automatic type conversion for method-style function calls, checking if values are already of the correct type or converting them if needed. It’s particularly useful for defining methods that operate on specific value types like arrays or closures.
The key difference from other macros is that it provides automatic type checking and conversion for method calls where the first argument is the value the method is being called on.