1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-08-01 12:48:31 +00:00
continuwuity/src/service/rooms/auth_chain/mod.rs

26 lines
577 B
Rust
Raw Normal View History

mod data;
use std::{sync::Arc, collections::HashSet};
pub use data::Data;
2021-08-12 23:04:00 +02:00
2022-09-07 13:25:51 +02:00
use crate::Result;
2021-08-14 19:07:50 +02:00
2022-10-05 12:45:54 +02:00
pub struct Service {
db: Box<dyn Data>,
}
2022-06-20 12:08:58 +02:00
2022-10-05 12:45:54 +02:00
impl Service {
2022-06-19 22:56:14 +02:00
#[tracing::instrument(skip(self))]
pub fn get_cached_eventid_authchain<'a>(
2022-06-19 22:56:14 +02:00
&'a self,
key: &[u64],
) -> Result<Option<Arc<HashSet<u64>>>> {
2022-10-05 15:33:57 +02:00
self.db.get_cached_eventid_authchain(key)
2021-04-11 21:01:27 +02:00
}
2021-02-28 12:41:03 +01:00
#[tracing::instrument(skip(self))]
pub fn cache_auth_chain(&self, key: Vec<u64>, auth_chain: Arc<HashSet<u64>>) -> Result<()> {
2022-10-05 15:33:57 +02:00
self.db.cache_auth_chain(key, auth_chain)
}
}