Skip to content

API reference

This project has two public API surfaces, and this page documents one of them.

  • The Python wrapper — documented below, rendered from the package's docstrings. This is what import rust_python_template gives you, and what most users want.
  • The rust-python-template-core Rust crate — documented by rustdoc and published to docs.rs. If you are depending on the core library from Rust rather than from Python, that is the reference you want.

Per ADR-0003 the Rust reference is not mirrored here; each surface is documented by its native tool.

rust_python_template

rust-python-template: a Rust-core + PyO3 + Python-wrapper library template.

The public symbols here are re-exported from the compiled ._core module, which is built from the -ffi crate. Importing this package requires that extension to have been built — run just develop or just bootstrap.

Examples:

>>> from rust_python_template import add
>>> add(2, 3)
5
>>> add(-5, -7)
-12

add builtin

add(a: int, b: int) -> int

Adds two integers. Thin wrapper over [core::add].