From a4efc83f7f29c6ef8ac9b4c57201c9ecc31266b3 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 7 Oct 2024 12:43:16 +0300 Subject: Add py_bindings lib, move to monorepo structure --- py_bindings/Cargo.toml | 11 +++++++++++ py_bindings/src/lib.rs | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 py_bindings/Cargo.toml create mode 100644 py_bindings/src/lib.rs (limited to 'py_bindings') diff --git a/py_bindings/Cargo.toml b/py_bindings/Cargo.toml new file mode 100644 index 0000000..2f7a83f --- /dev/null +++ b/py_bindings/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "py_bindings" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["lib"] + +[dependencies] +log_db = { path = "../log_db" } +pyo3 = "0.22.3" diff --git a/py_bindings/src/lib.rs b/py_bindings/src/lib.rs new file mode 100644 index 0000000..abee9f2 --- /dev/null +++ b/py_bindings/src/lib.rs @@ -0,0 +1,16 @@ +use log_db::*; + +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} -- cgit v1.3