pub struct GovernanceSection {
pub current_mhr: String,
pub epoch: u64,
pub transitions: Vec<GovernanceTransition>,
pub policy: GovernancePolicy,
}Expand description
Governance section attached to ENR identity documents.
Tracks the governing MHR, monotonic epoch counter, transition history, and governance policy constraints.
§Invariants
epochMUST strictly increase (no gaps, no rewinds).current_mhrMUST reference a valid, non-revoked MHR DID.- Each transition’s
fromMUST match the previous transition’sto.
§Examples
use oas_document::governance::GovernanceSection;
let json = r#"{
"currentMhr": "did:oas:prod:mhr:council-alpha",
"epoch": 1,
"transitions": [],
"policy": {
"transitionRequires": "mhr_threshold",
"signingKeyRotationRequires": "mhr_threshold",
"maxTransitionsPerDay": 1,
"timelockHours": 24
}
}"#;
let gov: GovernanceSection = serde_json::from_str(json).unwrap();
assert_eq!(gov.epoch, 1);Fields§
§current_mhr: StringDID of the MHR currently governing this ENR.
epoch: u64Monotonically increasing epoch counter. Incremented on every governance transition.
transitions: Vec<GovernanceTransition>Complete history of governance transitions.
policy: GovernancePolicyGovernance policy constraints.
Trait Implementations§
Source§impl Clone for GovernanceSection
impl Clone for GovernanceSection
Source§impl Debug for GovernanceSection
impl Debug for GovernanceSection
Source§impl<'de> Deserialize<'de> for GovernanceSection
impl<'de> Deserialize<'de> for GovernanceSection
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GovernanceSection
impl PartialEq for GovernanceSection
Source§impl Serialize for GovernanceSection
impl Serialize for GovernanceSection
impl StructuralPartialEq for GovernanceSection
Auto Trait Implementations§
impl Freeze for GovernanceSection
impl RefUnwindSafe for GovernanceSection
impl Send for GovernanceSection
impl Sync for GovernanceSection
impl Unpin for GovernanceSection
impl UnsafeUnpin for GovernanceSection
impl UnwindSafe for GovernanceSection
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
Mutably borrows from an owned value. Read more