pub trait FromArgs: Sized {
// Required method
fn from_args(
vm: &VirtualMachine,
args: &mut FuncArgs,
) -> Result<Self, ArgumentError>;
// Provided method
fn arity() -> RangeInclusive<usize> { ... }
}
Expand description
Implemented by any type that can be accepted as a parameter to a built-in function.
Required Methods§
Sourcefn from_args(
vm: &VirtualMachine,
args: &mut FuncArgs,
) -> Result<Self, ArgumentError>
fn from_args( vm: &VirtualMachine, args: &mut FuncArgs, ) -> Result<Self, ArgumentError>
Extracts this item from the next argument(s).
Provided Methods§
Sourcefn arity() -> RangeInclusive<usize>
fn arity() -> RangeInclusive<usize>
The range of positional arguments permitted by the function signature.
Returns an empty range if not applicable.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.