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

16 lines
442 B
Rust
Raw Normal View History

use std::{collections::HashSet, sync::Arc};
2022-10-05 12:45:54 +02:00
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: Arc<HashSet<CompressedStateEvent>>,
pub removed: Arc<HashSet<CompressedStateEvent>>,
}
2022-10-05 15:33:57 +02:00
pub trait Data: Send + Sync {
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<()>;
}