pub struct IdSpace {
pub space: IdSpaceKind,
pub value: String,
}Expand description
C-2 (0.8.19 / OPP-12 Phase-1, TC-8) — the typed, non-null, id-space-total
carrier for SearchHit::id. Subsumes the interim write_cursor id AND the
additive Cause-A stable_id field of prior releases: the value is the BARE
id (prefix stripped), and to_prefixed reproduces the
pre-swap stable_id string byte-for-byte (l:/h: unchanged) so
cross-session real-gold keying continues on id as a true no-op.
Lifecycle-addressability is a type check consumed downstream by the
transition/purge verbs: only Logical is
lifecycle-addressable; Content/Passage are total-but-not-addressable.
Fields§
§space: IdSpaceKindThe typed id-space (Logical/Content/Passage).
value: StringThe bare id value (id-space prefix stripped).
Implementations§
Source§impl IdSpace
impl IdSpace
Sourcepub fn logical(value: impl Into<String>) -> Self
pub fn logical(value: impl Into<String>) -> Self
A Logical ("l:") id carrying value (a logical_id).
Sourcepub fn content(value: impl Into<String>) -> Self
pub fn content(value: impl Into<String>) -> Self
A Content ("h:") id carrying value (a content hash).
Sourcepub fn passage(value: impl Into<String>) -> Self
pub fn passage(value: impl Into<String>) -> Self
A Passage ("p:") id carrying value (a caller-supplied ordinal).
Sourcepub fn to_prefixed(&self) -> String
pub fn to_prefixed(&self) -> String
The prefixed string form ({prefix}{value}) — byte-identical to the
pre-swap derive_stable_id output for l:/h:.
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parse the prefixed string form back into a typed IdSpace. Round-trip
stable: IdSpace::parse(&x.to_prefixed()) == Some(x). Only the FIRST
two-char id-space prefix is stripped, so a value that itself contains
":" round-trips unchanged. Returns None for an untagged string.