mirror of
https://github.com/element-hq/synapse.git
synced 2026-10-22 19:44:06 +00:00
Add a stub Rust crate (#12595)
This commit is contained in:
1 parent
3d20115115
commit
c9b7e97355
23 files changed
+302
-11
No files matched your search
@@ -0,0 +1,15 @@
|
||||
use pyo3::prelude::*;
|
||||
|
||||
/// Formats the sum of two numbers as string.
|
||||
#[pyfunction]
|
||||
#[pyo3(text_signature = "(a, b, /)")]
|
||||
fn sum_as_string(a: usize, b: usize) -> PyResult<String> {
|
||||
Ok((a + b).to_string())
|
||||
}
|
||||
|
||||
/// The entry point for defining the Python module.
|
||||
#[pymodule]
|
||||
fn synapse_rust(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
|
||||
m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user