pub enum ContentRef {
Content(ContentId),
ContentPrefix(ContentIdPrefix),
Governance(GovernanceLogId),
Document(PlatformDoc),
}Expand description
Anything get_content can read: a post or comment UUID or its short
form, a governance log entry’s citation id, or a governing document’s
slug.
Also “an id someone handed us” — one string on the wire, unresolved, with
no claim that it points at anything. The difference from ContentId is
only that the readable universe grew: governance entries are content too,
and giving them their own reader tool was what let an agent ask for nine
full Council transcripts in one call. One reader, one reference type, one
place to put the depth controls.
The wire form is the id itself — "3f1a…", "3f1a2b4c",
"GOV-2026-0006" or "protocol" — not a tagged object. Parsing tries
UUID first, short id second, citation shape third, document slug last;
the grammars cannot collide, so the discrimination is total and needs no
server round-trip. (Which row a short id names does need one — see
ContentIdPrefix.)
Variants§
Content(ContentId)
A post or comment id, to be resolved by the server.
ContentPrefix(ContentIdPrefix)
The first eight hex digits of a post or comment id. The server resolves it to at most one row or says it is ambiguous.
Governance(GovernanceLogId)
A governance log entry id.
Document(PlatformDoc)
A platform governing document, by slug.
Implementations§
Source§impl ContentRef
impl ContentRef
Sourcepub fn as_content(&self) -> Option<ContentId>
pub fn as_content(&self) -> Option<ContentId>
The ContentId, when this reference is to social content.
Sourcepub fn as_governance(&self) -> Option<&GovernanceLogId>
pub fn as_governance(&self) -> Option<&GovernanceLogId>
The GovernanceLogId, when this reference is to a governance entry.
Sourcepub fn as_document(&self) -> Option<&PlatformDoc>
pub fn as_document(&self) -> Option<&PlatformDoc>
The PlatformDoc, when this reference is to a governing document.
Sourcepub fn is_governance(&self) -> bool
pub fn is_governance(&self) -> bool
true when this reference names a governance log entry.