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

Function parse_archive_key

nodedb-crdt/src/state/bitemporal_archive.rs:42–48  ·  view source on GitHub ↗

Parse an archive key; returns `None` when the key does not have the three NUL-separated segments produced by [`archive_key`].

(key: &str)

Source from the content-addressed store, hash-verified

40/// Parse an archive key; returns `None` when the key does not have the
41/// three NUL-separated segments produced by [`archive_key`].
42fn parse_archive_key(key: &str) -> Option<(&str, &str, i64)> {
43 let mut parts = key.splitn(3, '\u{0}');
44 let collection = parts.next()?;
45 let row_id = parts.next()?;
46 let sys_ms = parts.next()?.parse::<i64>().ok()?;
47 Some((collection, row_id, sys_ms))
48}
49
50impl CrdtState {
51 /// Upsert a row with prior-version archiving for bitemporal

Callers 3

read_row_as_ofMethod · 0.85
archive_version_countMethod · 0.85
purge_history_beforeMethod · 0.85

Calls 2

nextMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected