diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2024-10-07 12:43:16 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2024-10-07 12:43:16 +0300 |
| commit | a4efc83f7f29c6ef8ac9b4c57201c9ecc31266b3 (patch) | |
| tree | a18c856a5fc15fe509d3e3277e345176608dee21 /py_bindings | |
| parent | 30295ba5e1bdbfa69ad98fc5908ee4b1aabbd2e5 (diff) | |
Add py_bindings lib, move to monorepo structure
Diffstat (limited to 'py_bindings')
| -rw-r--r-- | py_bindings/Cargo.toml | 11 | ||||
| -rw-r--r-- | py_bindings/src/lib.rs | 16 |
2 files changed, 27 insertions, 0 deletions
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); + } +} |
