mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-20 09:11:24 +01:00
Add wrapper types for short IDs
This commit is contained in:
parent
f1642c92d1
commit
b0f33207fe
28 changed files with 427 additions and 232 deletions
|
|
@ -1,19 +1,22 @@
|
|||
use std::{collections::HashSet, sync::Arc};
|
||||
|
||||
use super::CompressedStateEvent;
|
||||
use crate::Result;
|
||||
use crate::{service::rooms::short::ShortStateHash, Result};
|
||||
|
||||
pub(crate) struct StateDiff {
|
||||
pub(crate) parent: Option<u64>,
|
||||
pub(crate) parent: Option<ShortStateHash>,
|
||||
pub(crate) added: Arc<HashSet<CompressedStateEvent>>,
|
||||
pub(crate) removed: Arc<HashSet<CompressedStateEvent>>,
|
||||
}
|
||||
|
||||
pub(crate) trait Data: Send + Sync {
|
||||
fn get_statediff(&self, shortstatehash: u64) -> Result<StateDiff>;
|
||||
fn get_statediff(
|
||||
&self,
|
||||
shortstatehash: ShortStateHash,
|
||||
) -> Result<StateDiff>;
|
||||
fn save_statediff(
|
||||
&self,
|
||||
shortstatehash: u64,
|
||||
shortstatehash: ShortStateHash,
|
||||
diff: StateDiff,
|
||||
) -> Result<()>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue