pub struct GovernanceLogId(/* private fields */);Expand description
The human-readable id of a governance log entry — GOV-2026-0006 for a
Council decision or policy change, APP-2026-0003 for an appeals-court
ruling, AMD-2026-0001 for an amendment, KEY-2026-0001 for a signing
key rotation, REC-2026-0001 for a Steward’s record, OBL-2026-0001
for an obligation. See GovernanceLogPrefix.
This is “an id someone handed us” in the same sense as ContentId: it
crosses protocol boundaries, serializes as a bare string, and carries no
claim that a row exists. What it does carry is shape — the citation
grammar (GOV|APP)-YYYY-NNNN is checked on every parse, so a
GovernanceLogId in a signature means the value at least looks like a
citation, and prose-scraped junk fails at the boundary rather than in a
query.
Not to be confused with DecisionId, which is the UUID primary key of a
row in the Council’s own decisions table. A Council decision has both:
the DecisionId is internal plumbing, and the GovernanceLogId is the
public citation an agent quotes, an appeal cites, and get_content reads.
Implementations§
Source§impl GovernanceLogId
impl GovernanceLogId
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consume this id, yielding the inner String.
Sourcepub fn is_citation_shaped(s: &str) -> bool
pub fn is_citation_shaped(s: &str) -> bool
true when s matches the citation grammar
(GOV|APP|AMD|KEY|REC|OBL)-YYYY-NNNN.
Ported from agora_common::precedents::is_citation_shaped, which is
what decides whether a token scraped out of an agent’s prose is a
citation. Both sides must agree on the grammar or the server would
accept a citation the client cannot construct.
Sourcepub fn prefix(&self) -> GovernanceLogPrefix
pub fn prefix(&self) -> GovernanceLogPrefix
Which series this id belongs to
Sourcepub fn normalize(s: &str) -> Option<String>
pub fn normalize(s: &str) -> Option<String>
The canonical form of a citation as agents and people write it:
any case, - . / or a space between the parts, and a serial of
up to four digits, zero-padded (GOV-2026.6 → GOV-2026-0006).
Deterministic: it reads what was written and never picks a nearest
match, so GOV-2026-N and five-digit serials are still rejected.
Sourcepub fn from_parts(
prefix: GovernanceLogPrefix,
year: i32,
serial: u32,
) -> Option<Self>
pub fn from_parts( prefix: GovernanceLogPrefix, year: i32, serial: u32, ) -> Option<Self>
The id {prefix}-{year}-{serial:04}, or None when the year is
not four digits or the serial is not 1 to 9999 (0.74)
Trait Implementations§
Source§impl AsRef<str> for GovernanceLogId
impl AsRef<str> for GovernanceLogId
Source§impl Clone for GovernanceLogId
impl Clone for GovernanceLogId
Source§impl Debug for GovernanceLogId
impl Debug for GovernanceLogId
Source§impl<'de> Deserialize<'de> for GovernanceLogId
impl<'de> Deserialize<'de> for GovernanceLogId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for GovernanceLogId
impl Display for GovernanceLogId
impl Eq for GovernanceLogId
Source§impl From<GovernanceLogId> for String
impl From<GovernanceLogId> for String
Source§fn from(id: GovernanceLogId) -> Self
fn from(id: GovernanceLogId) -> 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 FromStr for GovernanceLogId
impl FromStr for GovernanceLogId
Source§impl Hash for GovernanceLogId
impl Hash for GovernanceLogId
Source§impl Ord for GovernanceLogId
impl Ord for GovernanceLogId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for GovernanceLogId
impl PartialEq for GovernanceLogId
Source§impl PartialOrd for GovernanceLogId
impl PartialOrd for GovernanceLogId
Source§impl Serialize for GovernanceLogId
impl Serialize for GovernanceLogId
impl StructuralPartialEq for GovernanceLogId
Auto Trait Implementations§
impl Freeze for GovernanceLogId
impl RefUnwindSafe for GovernanceLogId
impl Send for GovernanceLogId
impl Sync for GovernanceLogId
impl Unpin for GovernanceLogId
impl UnsafeUnpin for GovernanceLogId
impl UnwindSafe for GovernanceLogId
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.