messing with trait objects
This commit is contained in:
parent
8708cd3b63
commit
face766e0f
61 changed files with 623 additions and 544 deletions
|
@ -3,8 +3,8 @@ use std::{collections::HashSet, mem::size_of};
|
|||
use crate::{service, database::KeyValueDatabase, Result, utils};
|
||||
|
||||
impl service::rooms::auth_chain::Data for KeyValueDatabase {
|
||||
fn get_cached_eventid_authchain(&self, shorteventid: u64) -> Result<HashSet<u64>> {
|
||||
self.shorteventid_authchain
|
||||
fn get_cached_eventid_authchain(&self, shorteventid: u64) -> Result<Option<HashSet<u64>>> {
|
||||
Ok(self.shorteventid_authchain
|
||||
.get(&shorteventid.to_be_bytes())?
|
||||
.map(|chain| {
|
||||
chain
|
||||
|
@ -13,7 +13,7 @@ impl service::rooms::auth_chain::Data for KeyValueDatabase {
|
|||
utils::u64_from_bytes(chunk).expect("byte length is correct")
|
||||
})
|
||||
.collect()
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
||||
fn cache_eventid_authchain(&self, shorteventid: u64, auth_chain: &HashSet<u64>) -> Result<()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue