summary refs log tree commit diff
path: root/rust/src
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2024-05-07 11:48:08 +0100
committerErik Johnston <erik@matrix.org>2024-05-07 11:48:08 +0100
commitfa68816fb858081b880557af8baee03e9325e494 (patch)
tree7a24c8bc68ca45ec4ca84d51dbf6e1076476599d /rust/src
parentMerge remote-tracking branch 'origin/release-v1.106' into matrix-org-hotfixes (diff)
parentBump serde from 1.0.199 to 1.0.200 (#17161) (diff)
downloadsynapse-fa68816fb858081b880557af8baee03e9325e494.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/events/internal_metadata.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/rust/src/events/internal_metadata.rs b/rust/src/events/internal_metadata.rs

index a53601862d..53c7b1ba61 100644 --- a/rust/src/events/internal_metadata.rs +++ b/rust/src/events/internal_metadata.rs
@@ -20,8 +20,10 @@ //! Implements the internal metadata class attached to events. //! -//! The internal metadata is a bit like a `TypedDict`, in that it is stored as a -//! JSON dict in the DB. Most events have zero, or only a few, of these keys +//! The internal metadata is a bit like a `TypedDict`, in that most of +//! it is stored as a JSON dict in the DB (the exceptions being `outlier` +//! and `stream_ordering` which have their own columns in the database). +//! Most events have zero, or only a few, of these keys //! set. Therefore, since we care more about memory size than performance here, //! we store these fields in a mapping. //! @@ -234,6 +236,9 @@ impl EventInternalMetadata { self.clone() } + /// Get a dict holding the data stored in the `internal_metadata` column in the database. + /// + /// Note that `outlier` and `stream_ordering` are stored in separate columns so are not returned here. fn get_dict(&self, py: Python<'_>) -> PyResult<PyObject> { let dict = PyDict::new(py);