pub enum ContentRef {
Content(ContentId),
ContentPrefix(ContentIdPrefix),
Governance(GovernanceLogId),
DataCitation(DataCitation),
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.
DataCitation(DataCitation)
A data set’s file at a commit, and maybe some of its lines:
DATA-2026-0001:<commit>:<path>:110-300 (0.103), or without the
commit DATA-2026-0001:/<path>:110-300 (0.110.0)
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 as_data_citation(&self) -> Option<&DataCitation>
pub fn as_data_citation(&self) -> Option<&DataCitation>
The DataCitation, when this
reference cites a data set’s file (0.103)
Sourcepub fn data_set(&self) -> Option<&GovernanceLogId>
pub fn data_set(&self) -> Option<&GovernanceLogId>
The data set (DATA-…) this reference reads: the set itself, or a
file cited in it (0.103)
Sourcepub fn is_governance(&self) -> bool
pub fn is_governance(&self) -> bool
true when this reference names a governance log entry; a
DataCitation names a file, not the
entry.
Trait Implementations§
Source§impl Clone for ContentRef
impl Clone for ContentRef
Source§impl Debug for ContentRef
impl Debug for ContentRef
Source§impl<'de> Deserialize<'de> for ContentRef
impl<'de> Deserialize<'de> for ContentRef
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Display for ContentRef
impl Display for ContentRef
impl Eq for ContentRef
Source§impl From<CommentId> for ContentRef
impl From<CommentId> for ContentRef
Source§impl From<ContentId> for ContentRef
impl From<ContentId> for ContentRef
Source§impl From<ContentIdPrefix> for ContentRef
impl From<ContentIdPrefix> for ContentRef
Source§fn from(prefix: ContentIdPrefix) -> Self
fn from(prefix: ContentIdPrefix) -> Self
Source§impl From<ContentRef> for AgoraLink
impl From<ContentRef> for AgoraLink
Source§fn from(id: ContentRef) -> Self
fn from(id: ContentRef) -> Self
Source§impl From<DataCitation> for ContentRef
impl From<DataCitation> for ContentRef
Source§fn from(c: DataCitation) -> Self
fn from(c: DataCitation) -> Self
Source§impl From<GovernanceLogId> for ContentRef
impl From<GovernanceLogId> for ContentRef
Source§fn from(id: GovernanceLogId) -> Self
fn from(id: GovernanceLogId) -> Self
Source§impl From<PlatformDoc> for ContentRef
impl From<PlatformDoc> for ContentRef
Source§fn from(doc: PlatformDoc) -> Self
fn from(doc: PlatformDoc) -> Self
Source§impl From<PostId> for ContentRef
impl From<PostId> for ContentRef
Source§impl FromStr for ContentRef
impl FromStr for ContentRef
Source§impl Hash for ContentRef
impl Hash for ContentRef
Source§impl PartialEq for ContentRef
impl PartialEq for ContentRef
Source§impl Serialize for ContentRef
impl Serialize for ContentRef
impl StructuralPartialEq for ContentRef
Auto Trait Implementations§
impl Freeze for ContentRef
impl RefUnwindSafe for ContentRef
impl Send for ContentRef
impl Sync for ContentRef
impl Unpin for ContentRef
impl UnsafeUnpin for ContentRef
impl UnwindSafe for ContentRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
fn validate_matches(&self, other: &O) -> bool
impl<T> PendingHandle for Twhere
T: Send + 'static,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more