Module pyo3_stub_gen::type_info

source ·
Expand description

Store of metadata for generating Python stub file

Stub file generation takes two steps:

§Store metadata (compile time)

Embed compile-time information about Rust types and PyO3 macro arguments using inventory::submit! macro into source codes, and these information will be gathered by inventory::iter. This submodule is responsible for this process.

  • PyClassInfo stores information obtained from #[pyclass] macro
  • PyMethodsInfo stores information obtained from #[pymethods] macro

and others are their components.

§Gathering metadata and generating stub file (runtime)

Since #[pyclass] and #[pymethods] definitions are not bundled in a single block, we have to reconstruct these information corresponding to a Python class. This process is done at runtime in gen_stub executable.

Structs§

Functions§