Expand description
Trampolines for various pyfunction and pymethod implementations.
They exist to monomorphise std::panic::catch_unwind once into PyO3, rather than inline in every function, thus saving a huge amount of compile-time complexity.
Re-exportsΒ§
pub use get_trampoline_function;pub use self::fastcall_cfunction_with_keywords as maybe_fastcall_cfunction_with_keywords;Py_3_10or non-Py_LIMITED_APIpub use self::fastcall_cfunction_with_keywords as maybe_fastcall_cfunction_with_keywords;Py_3_10or non-Py_LIMITED_API
ModulesΒ§
- binaryfunc
- Companion module contains the function pointer type.
- cfunction_
with_ keywords - Companion module contains the function pointer type.
- descrgetfunc
- Companion module contains the function pointer type.
- fastcall_
cfunction_ with_ keywords - Companion module contains the function pointer type.
- getattrofunc
- Companion module contains the function pointer type.
- getbufferproc
- Companion module contains the function pointer type.
- getiterfunc
- Companion module contains the function pointer type.
- hashfunc
- Companion module contains the function pointer type.
- initproc
- Companion module contains the function pointer type.
- inquiry
- Companion module contains the function pointer type.
- iternextfunc
- Companion module contains the function pointer type.
- lenfunc
- Companion module contains the function pointer type.
- newfunc
- Companion module contains the function pointer type.
- noargs
- objobjproc
- Companion module contains the function pointer type.
- releasebufferproc
Non- Py_LIMITED_APIorPy_3_11 - reprfunc
- Companion module contains the function pointer type.
- richcmpfunc
- Companion module contains the function pointer type.
- setattrofunc
- Companion module contains the function pointer type.
- ssizeargfunc
- Companion module contains the function pointer type.
- ternaryfunc
- Companion module contains the function pointer type.
- unaryfunc
- Companion module contains the function pointer type.
MacrosΒ§
- trampoline π
- Macro to define a trampoline function for a given function signature.
- trampolines π
TraitsΒ§
- Method
Def - A workaround for Rust not allowing function pointers as const generics: define a trait which has a constant function pointer.
FunctionsΒ§
- binaryfuncβ
- External symbol called by Python, which calls the provided Rust function.
- cfunction_
with_ βkeywords - External symbol called by Python, which calls the provided Rust function.
- dealloc π β
- Safety
- descrgetfuncβ
- External symbol called by Python, which calls the provided Rust function.
- fastcall_
cfunction_ βwith_ keywords - External symbol called by Python, which calls the provided Rust function.
- getattrofuncβ
- External symbol called by Python, which calls the provided Rust function.
- getbufferprocβ
- External symbol called by Python, which calls the provided Rust function.
- getiterfuncβ
- External symbol called by Python, which calls the provided Rust function.
- hashfuncβ
- External symbol called by Python, which calls the provided Rust function.
- initprocβ
- External symbol called by Python, which calls the provided Rust function.
- inquiryβ
- External symbol called by Python, which calls the provided Rust function.
- iternextfuncβ
- External symbol called by Python, which calls the provided Rust function.
- lenfuncβ
- External symbol called by Python, which calls the provided Rust function.
- module_
exec β - newfuncβ
- External symbol called by Python, which calls the provided Rust function.
- noargsβ
- Noargs is a special case where the
_argsparameter is unused and not passed to the innerFunc. - objobjprocβ
- External symbol called by Python, which calls the provided Rust function.
- panic_
result_ πinto_ callback_ output - Converts the output of std::panic::catch_unwind into a Python function output, either by raising a Python exception or by unwrapping the contained success output.
- releasebufferprocβ
Non- Py_LIMITED_APIorPy_3_11 - Releasebufferproc is a special case where the function cannot return an error, so we use trampoline_unraisable.
- reprfuncβ
- External symbol called by Python, which calls the provided Rust function.
- richcmpfuncβ
- External symbol called by Python, which calls the provided Rust function.
- setattrofuncβ
- External symbol called by Python, which calls the provided Rust function.
- ssizeargfuncβ
- External symbol called by Python, which calls the provided Rust function.
- ternaryfuncβ
- External symbol called by Python, which calls the provided Rust function.
- trampoline π β
- Implementation of trampoline functions, which sets up an AttachGuard and calls F.
- trampoline_
unraisable π β - Implementation of trampoline for functions which canβt return an error.
- unaryfuncβ
- External symbol called by Python, which calls the provided Rust function.