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

Method already_seen

nodedb/src/control/array_sync/apply.rs:54–59  ·  view source on GitHub ↗

Return `true` if an op with `hlc` has already been applied to `array`. Performs a point scan on the op-log: if the key `(array, hlc)` exists, the op was previously applied.

(&self, array: &str, hlc: Hlc)

Source from the content-addressed store, hash-verified

52 /// Performs a point scan on the op-log: if the key `(array, hlc)` exists,
53 /// the op was previously applied.
54 pub fn already_seen(&self, array: &str, hlc: Hlc) -> bool {
55 match self.op_log.scan_range(array, hlc, hlc) {
56 Ok(mut iter) => iter.next().is_some(),
57 Err(_) => false,
58 }
59 }
60
61 /// Record that an op has been applied by appending it to the durable op-log.
62 ///

Callers 2

apply_opMethod · 0.45
apply_array_opFunction · 0.45

Calls 2

scan_rangeMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected