pyo3::impl_::extract_argument

Trait VarargsHandler

Source
pub trait VarargsHandler<'py> {
    type Varargs;

    // Required methods
    fn handle_varargs_fastcall(
        py: Python<'py>,
        varargs: &[Option<Borrowed<'py, 'py, PyAny>>],
        function_description: &FunctionDescription,
    ) -> PyResult<Self::Varargs>;
    fn handle_varargs_tuple(
        args: &Bound<'py, PyTuple>,
        function_description: &FunctionDescription,
    ) -> PyResult<Self::Varargs>;
}
Expand description

A trait used to control whether to accept varargs in FunctionDescription::extract_argument_(method) functions.

Required Associated Types§

Required Methods§

Source

fn handle_varargs_fastcall( py: Python<'py>, varargs: &[Option<Borrowed<'py, 'py, PyAny>>], function_description: &FunctionDescription, ) -> PyResult<Self::Varargs>

Called by FunctionDescription::extract_arguments_fastcall with any additional arguments.

Source

fn handle_varargs_tuple( args: &Bound<'py, PyTuple>, function_description: &FunctionDescription, ) -> PyResult<Self::Varargs>

Called by FunctionDescription::extract_arguments_tuple_dict with the original tuple.

Additional arguments are those in the tuple slice starting from function_description.positional_parameter_names.len().

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.

Implementors§

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here