MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / dispatch_crdt

Method dispatch_crdt

nodedb/src/data/executor/dispatch/crdt.rs:12–105  ·  view source on GitHub ↗
(&mut self, task: &ExecutionTask, op: &CrdtOp)

Source from the content-addressed store, hash-verified

10
11impl CoreLoop {
12 pub(super) fn dispatch_crdt(&mut self, task: &ExecutionTask, op: &CrdtOp) -> Response {
13 match op {
14 CrdtOp::Read {
15 collection,
16 document_id,
17 } => self.execute_crdt_read(task, collection, document_id),
18
19 CrdtOp::Apply {
20 collection: _,
21 document_id: _,
22 delta,
23 peer_id: _,
24 mutation_id: _,
25 surrogate: _,
26 } => self.execute_crdt_apply(task, delta),
27
28 CrdtOp::SetPolicy {
29 collection,
30 policy_json,
31 } => self.execute_set_collection_policy(task, collection, policy_json),
32
33 CrdtOp::GetPolicy { collection } => {
34 self.execute_get_collection_policy(task, collection)
35 }
36
37 CrdtOp::ReadAtVersion {
38 collection,
39 document_id,
40 version_vector_json,
41 } => self.execute_crdt_read_at_version(
42 task,
43 collection,
44 document_id,
45 version_vector_json,
46 ),
47
48 CrdtOp::GetVersionVector => self.execute_crdt_get_version_vector(task),
49
50 CrdtOp::ExportDelta { from_version_json } => {
51 self.execute_crdt_export_delta(task, from_version_json)
52 }
53
54 CrdtOp::RestoreToVersion {
55 collection,
56 document_id,
57 target_version_json,
58 surrogate: _,
59 } => self.execute_crdt_restore(task, collection, document_id, target_version_json),
60
61 CrdtOp::CompactAtVersion {
62 target_version_json,
63 } => self.execute_crdt_compact(task, target_version_json),
64
65 CrdtOp::ListInsert {
66 collection,
67 document_id,
68 list_path,
69 index,

Callers 1

crdtMethod · 0.80

Tested by

no test coverage detected