summary refs log tree commit diff
path: root/rust/src
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-09-12 15:34:02 -0500
committerEric Eastwood <erice@element.io>2022-09-12 15:34:02 -0500
commit6c40dfafcf32395fbc1fb4df3297c308ed003c3b (patch)
tree07a98db8f7c09f79bbf58758a0170768ed081ed7 /rust/src
parentpoetry update (diff)
parentFix GHA skippable syntax (#13778) (diff)
downloadsynapse-6c40dfafcf32395fbc1fb4df3297c308ed003c3b.tar.xz
Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs

index 142fc2ed93..ba42465fb8 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs
@@ -1,5 +1,13 @@ use pyo3::prelude::*; +/// Returns the hash of all the rust source files at the time it was compiled. +/// +/// Used by python to detect if the rust library is outdated. +#[pyfunction] +fn get_rust_file_digest() -> &'static str { + env!("SYNAPSE_RUST_DIGEST") +} + /// Formats the sum of two numbers as string. #[pyfunction] #[pyo3(text_signature = "(a, b, /)")] @@ -11,6 +19,6 @@ fn sum_as_string(a: usize, b: usize) -> PyResult<String> { #[pymodule] fn synapse_rust(_py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(sum_as_string, m)?)?; - + m.add_function(wrap_pyfunction!(get_rust_file_digest, m)?)?; Ok(()) }