Build a tenant-scoped index key `"{tenant}:{a}:{b}:{c}:{d}"`.
(
tenant_id: u64,
a: &str,
b: &str,
c: &str,
d: &str,
f: impl FnOnce(&str) -> R,
)
| 43 | |
| 44 | /// Build a tenant-scoped index key `"{tenant}:{a}:{b}:{c}:{d}"`. |
| 45 | pub(super) fn with_tenant_key4<R>( |
| 46 | tenant_id: u64, |
| 47 | a: &str, |
| 48 | b: &str, |
| 49 | c: &str, |
| 50 | d: &str, |
| 51 | f: impl FnOnce(&str) -> R, |
| 52 | ) -> R { |
| 53 | KEY_BUF.with(|buf| { |
| 54 | let mut buf = buf.borrow_mut(); |
| 55 | buf.clear(); |
| 56 | use std::fmt::Write; |
| 57 | let _ = write!(buf, "{tenant_id}"); |
| 58 | buf.push(':'); |
| 59 | buf.push_str(a); |
| 60 | buf.push(':'); |
| 61 | buf.push_str(b); |
| 62 | buf.push(':'); |
| 63 | buf.push_str(c); |
| 64 | buf.push(':'); |
| 65 | buf.push_str(d); |
| 66 | f(&buf) |
| 67 | }) |
| 68 | } |
| 69 | |
| 70 | /// redb-backed B-Tree storage engine for sparse/metadata queries. |
| 71 | pub struct SparseEngine { |
no test coverage detected