summary refs log tree commit diff
path: root/rust/src/lib.rs
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-09-20 12:10:31 +0100
committerGitHub <noreply@github.com>2022-09-20 12:10:31 +0100
commit42d261c32f13e2de7494a0ade77c1f7b646af1fe (patch)
treeaf5526ed2e27eddc8b24ef22d035927fa5b32ca6 /rust/src/lib.rs
parentDon't include redundant prev_state in new events (#13791) (diff)
downloadsynapse-42d261c32f13e2de7494a0ade77c1f7b646af1fe.tar.xz
Port the push rule classes to Rust. (#13768)
Diffstat (limited to 'rust/src/lib.rs')
-rw-r--r--rust/src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index ba42465fb8..c7b60e58a7 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -1,5 +1,7 @@
 use pyo3::prelude::*;
 
+pub mod push;
+
 /// 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.
@@ -17,8 +19,13 @@ fn sum_as_string(a: usize, b: usize) -> PyResult<String> {
 
 /// The entry point for defining the Python module.
 #[pymodule]
-fn synapse_rust(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
+fn synapse_rust(py: Python<'_>, m: &PyModule) -> PyResult<()> {
+    pyo3_log::init();
+
     m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
     m.add_function(wrap_pyfunction!(get_rust_file_digest, m)?)?;
+
+    push::register_module(py, m)?;
+
     Ok(())
 }