pub struct Effective {
pub rules: Vec<GovernanceRule>,
pub limits: Limits,
pub deny_actions: Vec<String>,
pub require_approval_actions: Vec<String>,
pub parent_hash: [u8; 32],
pub overlay_hash: [u8; 32],
pub effective_hash: [u8; 32],
pub parent_version: u64,
}Expand description
The merged result a project kernel runs with.
Fields§
§rules: Vec<GovernanceRule>Parent rules (verbatim) then the overlay’s rules.
limits: LimitsEffective limits: min for numbers, OR for flags.
deny_actions: Vec<String>Every action glob denied by a parent or overlay rule.
require_approval_actions: Vec<String>Every action glob forced to human approval.
parent_hash: [u8; 32]Hash of the parent’s rules and limits.
overlay_hash: [u8; 32]Hash of the overlay.
effective_hash: [u8; 32]Hash of the merged rule set; the chain’s rule_hash.
parent_version: u64The parent policy version this was merged from.
Implementations§
Source§impl Effective
impl Effective
Sourcepub fn into_rules(self) -> Vec<GovernanceRule>
pub fn into_rules(self) -> Vec<GovernanceRule>
The rules, to feed GovernanceEngine::add_rule one by one.
Sourcepub fn risk_threshold(&self, default: f64) -> f64
pub fn risk_threshold(&self, default: f64) -> f64
Engine threshold: the effective limit, else default.
Sourcepub fn human_approval(&self, default: bool) -> bool
pub fn human_approval(&self, default: bool) -> bool
Engine human-approval flag: the effective limit, else default.
Sourcepub fn effective_hash_hex(&self) -> String
pub fn effective_hash_hex(&self) -> String
effective_hash as lowercase hex.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Effective
impl RefUnwindSafe for Effective
impl Send for Effective
impl Sync for Effective
impl Unpin for Effective
impl UnsafeUnpin for Effective
impl UnwindSafe for Effective
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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