/rust_binding_examples

Primary LanguageRustBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Migrate to https://github.com/kitsuyui/rust-playground

rust_binding_examples

codecov

This repo is intended to show how to build rust-python binding packages.

Example rust module

amazing-calc provides very simple function as following:

pub fn my_calc(a: i64, b: i64, c: i64) -> String {
    ((a + b) * c).to_string()
}
my_calc(1, 2, 3)  // => "9"

Python package

See also /python/README.md

Install

Warning: Currently this package is only distributed on TestPyPI.

pip install -i https://test.pypi.org/simple/ amazing-calc
from amazing_calc import my_calc
my_calc(1, 2, 3)  # => '9'

Build

cd python
pipenv run build

LICENSE

The 3-Clause BSD License. See also LICENSE file.