style: Document & refactor rooms/outlier service

This commit is contained in:
timedout committed 2026-06-27 18:36:44 +01:00
1 parent 4bf0816bcc
commit 5e0e82e7e8
1 file changed
+21 -23
+21 -23
View File
@@ -24,29 +24,27 @@ impl crate::Service for Service {
fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
}
/// Returns the pdu from the outlier tree.
#[implement(Service)]
pub async fn get_outlier_pdu_json(&self, event_id: &EventId) -> Result<CanonicalJsonObject> {
self.db
.eventid_outlierpdu
.get(event_id)
.await
.deserialized()
}
impl Service {
/// Returns the pdu from the outlier tree.
pub async fn get_outlier_pdu_json(&self, event_id: &EventId) -> Result<CanonicalJsonObject> {
self.db
.eventid_outlierpdu
.get(event_id)
.await
.deserialized()
}
/// Returns the pdu from the outlier tree.
#[implement(Service)]
pub async fn get_pdu_outlier(&self, event_id: &EventId) -> Result<PduEvent> {
self.db
.eventid_outlierpdu
.get(event_id)
.await
.deserialized()
}
/// Returns the pdu from the outlier tree.
pub async fn get_pdu_outlier(&self, event_id: &EventId) -> Result<PduEvent> {
self.db
.eventid_outlierpdu
.get(event_id)
.await
.deserialized()
}
/// Append the PDU as an outlier.
#[implement(Service)]
#[tracing::instrument(skip(self, pdu), level = "debug")]
pub fn add_pdu_outlier(&self, event_id: &EventId, pdu: &CanonicalJsonObject) {
self.db.eventid_outlierpdu.raw_put(event_id, Json(pdu));
/// Append the PDU as an outlier.
pub fn add_pdu_outlier(&self, event_id: &EventId, pdu: &CanonicalJsonObject) {
self.db.eventid_outlierpdu.raw_put(event_id, Json(pdu));
}
}