mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2025-12-11 20:15:30 +01:00
Iterator for CompressedCRDTOperationsPerModel
This commit is contained in:
parent
0ac38b6845
commit
02e4bf4d5b
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -4310,7 +4310,7 @@ dependencies = [
|
||||
"iana-time-zone-haiku",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"windows-core 0.51.1",
|
||||
"windows-core 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@ -5,7 +5,7 @@ use std::collections::BTreeMap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uhlc::NTP64;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct CompressedCRDTOperationsPerModel(pub Vec<(ModelId, CompressedCRDTOperationsPerRecord)>);
|
||||
|
||||
pub type CompressedCRDTOperationsPerRecord = Vec<(RecordId, Vec<CompressedCRDTOperation>)>;
|
||||
@ -191,6 +191,14 @@ impl CompressedCRDTOperationsPerModel {
|
||||
}
|
||||
}
|
||||
|
||||
impl Iterator for CompressedCRDTOperationsPerModel {
|
||||
type Item = (ModelId, CompressedCRDTOperationsPerRecord);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.0.pop()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct CompressedCRDTOperation {
|
||||
pub timestamp: NTP64,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user