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

Function parse_sparse_key

nodedb/src/data/executor/sparse_vector_checkpoint.rs:137–144  ·  view source on GitHub ↗

Parse "{tid}:{collection}:{field}" into a (TenantId, String, String) tuple.

(key: &str)

Source from the content-addressed store, hash-verified

135
136/// Parse "{tid}:{collection}:{field}" into a (TenantId, String, String) tuple.
137fn parse_sparse_key(key: &str) -> Option<(crate::types::TenantId, String, String)> {
138 let mut parts = key.splitn(3, ':');
139 let tid_str = parts.next()?;
140 let coll = parts.next()?.to_string();
141 let field = parts.next().unwrap_or("_sparse").to_string();
142 let tid_u64: u64 = tid_str.parse().ok()?;
143 Some((crate::types::TenantId::new(tid_u64), coll, field))
144}

Callers 1

Calls 4

to_stringMethod · 0.80
nextMethod · 0.45
okMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected