Parse "{tid}:{collection}:{field}" into a (TenantId, String, String) tuple.
(key: &str)
| 135 | |
| 136 | /// Parse "{tid}:{collection}:{field}" into a (TenantId, String, String) tuple. |
| 137 | fn 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 | } |
no test coverage detected