pub struct Prepared { /* private fields */ }Expand description
Everything boot learned about a project’s governance, before the chain exists.
Implementations§
Source§impl Prepared
impl Prepared
Sourcepub fn commit(&self, chain: &ChainManager) -> Result<(), OverlayError>
pub fn commit(&self, chain: &ChainManager) -> Result<(), OverlayError>
Boot-time history checks against the project chain, then persist the rollback pin. Call once the chain is restored and before anything is appended to it.
- the pin is missing but the chain records an applied overlay: someone removed it to roll the parent policy back, so boot is refused;
overlay.tomlis missing but the last applied overlay was not empty: deleting the file must not clear the overlay (an empty file does).
Sourcepub fn apply_limits(&self, kc: &mut KernelConfig)
pub fn apply_limits(&self, kc: &mut KernelConfig)
Lower kc to the merged limits. A limit can only go down.
Sourcepub fn rules(&self) -> &[GovernanceRule]
pub fn rules(&self) -> &[GovernanceRule]
The merged rules (they replace the default set).
Sourcepub fn engine_params(&self) -> (f64, bool)
pub fn engine_params(&self) -> (f64, bool)
Engine threshold and human-approval flag for the gate.
Sourcepub fn install_provider(&self, chain: &ChainManager)
pub fn install_provider(&self, chain: &ChainManager)
Start stamping rule_hash on every chain append. Call before the
first governance event so genesis carries it.
Sourcepub fn into_runtime(
self,
gate: GovernanceGate,
chain: Arc<ChainManager>,
) -> (Arc<dyn GateBackend>, Arc<OverlayRuntime>)
pub fn into_runtime( self, gate: GovernanceGate, chain: Arc<ChainManager>, ) -> (Arc<dyn GateBackend>, Arc<OverlayRuntime>)
Wrap the boot gate (already built from Self::rules and
Self::engine_params) so it can be replaced, and record the
applied rules on the chain.
Auto Trait Implementations§
impl Freeze for Prepared
impl RefUnwindSafe for Prepared
impl Send for Prepared
impl Sync for Prepared
impl Unpin for Prepared
impl UnsafeUnpin for Prepared
impl UnwindSafe for Prepared
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more