interop
Maturin
- https://github.com/PyO3/maturin
- Builds and publishes Python native (machine code) modules that are written in Rust
- Makes such modules available from Python registry as if they were normal Python packages
PyO3
- https://github.com/pyo3/pyo3
- Bidirectional bindings
- Use Rust from Python
- Use Python from Rust
Use Rust from Python
-
maturin initallows creating Cargo project setup for use with PyO3 -
maturin developinstalls the package into a Python env such that it would be usable from Python>>> import written_in_rust >>> written_in_rust()
Use Python from Rust
-
Create Cargo project normally
-
Add pyo3 dep
#![allow(unused)] fn main() { use pyo3::prelude::* }