Added CRDT snapshotting

This commit is contained in:
Timmy
2026-06-29 20:11:52 +01:00
parent 3342d129c2
commit 4c965c73b2
6 changed files with 309 additions and 75 deletions
+6 -1
View File
@@ -7,6 +7,7 @@
use crate::debug::DebugView;
use crate::json_crdt::{CrdtNode, JsonValue, OpState};
use crate::op::{join_path, print_path, Op, PathSegment, SequenceNumber};
use serde::{Deserialize, Serialize};
use std::cmp::{max, Ordering};
use std::fmt::Debug;
@@ -14,7 +15,11 @@ use crate::keypair::AuthorId;
/// A simple delete-wins, last-writer-wins (LWW) register CRDT.
/// Basically only for adding support for primitives within a more complex CRDT
#[derive(Clone)]
#[derive(Clone, Serialize, Deserialize)]
#[serde(bound(
serialize = "T: serde::Serialize",
deserialize = "T: serde::de::DeserializeOwned"
))]
pub struct LwwRegisterCrdt<T>
where
T: CrdtNode,