Trait rustpython_vm::function::FromArgs
source · 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.