Remove useless wrapper Services

This commit is contained in:
Lambda 2024-05-11 15:03:42 +00:00 committed by Charles Hall
parent 87a1012ab5
commit ad7a5ea777
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
20 changed files with 43 additions and 530 deletions

View file

@ -1,30 +1,4 @@
mod data;
pub(crate) use data::Data;
use ruma::{CanonicalJsonObject, EventId};
use crate::Result;
pub(crate) struct Service {
pub(crate) db: &'static dyn Data,
}
impl Service {
/// Returns the pdu from the outlier tree.
pub(crate) fn get_outlier_pdu_json(
&self,
event_id: &EventId,
) -> Result<Option<CanonicalJsonObject>> {
self.db.get_outlier_pdu_json(event_id)
}
/// Append the PDU as an outlier.
#[tracing::instrument(skip(self, pdu))]
pub(crate) fn add_pdu_outlier(
&self,
event_id: &EventId,
pdu: &CanonicalJsonObject,
) -> Result<()> {
self.db.add_pdu_outlier(event_id, pdu)
}
}
pub(crate) type Service = &'static dyn Data;