conduwuit/src/service/rooms/state_compressor/data.rs

16 lines
406 B
Rust
Raw Normal View History

2022-10-05 12:45:54 +02:00
use std::collections::HashSet;
2022-09-07 13:25:51 +02:00
use super::CompressedStateEvent;
use crate::Result;
pub struct StateDiff {
2022-10-05 12:45:54 +02:00
pub parent: Option<u64>,
pub added: HashSet<CompressedStateEvent>,
pub removed: HashSet<CompressedStateEvent>,
}
pub trait Data {
2022-09-07 13:25:51 +02:00
fn get_statediff(&self, shortstatehash: u64) -> Result<StateDiff>;
fn save_statediff(&self, shortstatehash: u64, diff: StateDiff) -> Result<()>;
}