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

Function parse_sys_from

nodedb/src/engine/sparse/btree_versioned/key.rs:54–57  ·  view source on GitHub ↗

Extract `sys_from_ms` from a versioned key. Returns `None` if the key has no NUL separator (defensive — should not happen for keys produced by [`versioned_doc_key`]).

(key: &str)

Source from the content-addressed store, hash-verified

52/// has no NUL separator (defensive — should not happen for keys produced
53/// by [`versioned_doc_key`]).
54pub fn parse_sys_from(key: &str) -> Option<i64> {
55 let (_, suffix) = key.rsplit_once('\x00')?;
56 suffix.parse().ok()
57}
58
59/// Extract `doc_id` slice from a versioned key (between the `{coll}:` and
60/// `\x00` boundaries). Returns the whole remainder when parsing fails.

Callers

nothing calls this directly

Calls 2

okMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected