mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 12:16:54 +00:00
style: Document & refactor rooms/outlier service
This commit is contained in:
1 file changed
+21
-23
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user