Skip to main content

Module extract_argument

Module extract_argument 

Source

Modulesยง

function_argument ๐Ÿ”’
Seals PyFunctionArgument so that types outside PyO3 cannot implement it.
function_argument_holder ๐Ÿ”’
Seals FunctionArgumentHolder so that types outside PyO3 cannot implement it.
varargs_handler ๐Ÿ”’
Seals VarargsHandler so that types outside PyO3 cannot implement it.
varkeywords_halder ๐Ÿ”’
Seals VarkeywordsHandler so that types outside PyO3 cannot implement it.

Structsยง

DictVarkeywords
Marker struct which indicates unknown keywords should be collected into a PyDict.
FunctionDescription
Function argument specification for a #[pyfunction] or #[pymethod].
KeywordOnlyParameterDescription
NoVarargs
Marker struct which indicates varargs are not allowed.
NoVarkeywords
Marker struct which indicates unknown keywords are not permitted.
TupleVarargs
Marker struct which indicates varargs should be collected into a PyTuple.

Traitsยง

FunctionArgumentHolder
Trait for types which can be a function argument holder - they should to be able to const-initialize to an empty value.
PyFunctionArgument
A trait which is used to help PyO3 macros extract function arguments.
VarargsHandler
A trait used to control whether to accept varargs in FunctionDescription::extract_argument_(method) functions.
VarkeywordsHandler
A trait used to control whether to accept varkeywords in FunctionDescription::extract_argument_(method) functions.

Functionsยง

argument_extraction_error
Adds the argument name to the error message of an error which occurred during argument extraction.
cast_function_argumentโš 
Cast a raw *mut ffi::PyObject to a PyArg. This is used to access safer PyO3 APIs with the assumption that the borrowed argument is valid for the lifetime 'py.
cast_non_null_function_argumentโš 
Cast a NonNull<ffi::PyObject> to a PyArg. This is used to access safer PyO3 APIs with the assumption that the borrowed argument is valid for the lifetime 'py.
cast_optional_function_argumentโš 
As above, but for optional arguments which may be NULL.
extract_argument
The standard implementation of how PyO3 extracts a #[pyfunction] or #[pymethod] function argument.
extract_argument_with_default
Alternative to extract_argument used when the argument has a default value provided by an annotation.
extract_pyclass_ref
extract_pyclass_ref_mut
from_py_with
Alternative to extract_argument used when the argument has a #[pyo3(from_py_with)] annotation.
from_py_with_with_default
Alternative to extract_argument used when the argument has a #[pyo3(from_py_with)] annotation and also a default value.
push_parameter_list ๐Ÿ”’
unwrap_required_argumentโš 
Unwraps the Option<&PyAny> produced by the FunctionDescription extract_arguments_ methods. They check if required methods are all provided.
unwrap_required_argument_boundโš 
Variant of above used with from_py_with extractors on required arguments.

Type Aliasesยง

PyArg ๐Ÿ”’
Helper type used to keep implementation more concise.
โš ๏ธ Internal Docs โš ๏ธ Not Public API ๐Ÿ‘‰ Official Docs Here