pub enum RulesObservation {
Counted(RulesTally),
Cached(RulesTally),
Absent,
}Expand description
Where the rule tally came from: counted now, taken from the cache, or not there at all.
use majordomus_cli::environment::preflight::{derive, Observations, RulesObservation, RulesTally, Verdict};
let mut o = Observations::empty("demo", 0);
assert_eq!(derive(&o).check("governance.rules").unwrap().verdict, Verdict::Unknown);
// a cached tally with no commit to compare against cannot be current
o.rules = RulesObservation::Cached(RulesTally { rules: 4, ..Default::default() });
assert_eq!(derive(&o).check("governance.rules").unwrap().verdict, Verdict::Stale);Variants§
Counted(RulesTally)
Counted in this process.
Cached(RulesTally)
Taken from the cache a full resolution wrote.
Absent
Neither.
Trait Implementations§
Source§impl Clone for RulesObservation
impl Clone for RulesObservation
Source§fn clone(&self) -> RulesObservation
fn clone(&self) -> RulesObservation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RulesObservation
impl Debug for RulesObservation
impl Eq for RulesObservation
Source§impl PartialEq for RulesObservation
impl PartialEq for RulesObservation
Source§fn eq(&self, other: &RulesObservation) -> bool
fn eq(&self, other: &RulesObservation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RulesObservation
Auto Trait Implementations§
impl Freeze for RulesObservation
impl RefUnwindSafe for RulesObservation
impl Send for RulesObservation
impl Sync for RulesObservation
impl Unpin for RulesObservation
impl UnsafeUnpin for RulesObservation
impl UnwindSafe for RulesObservation
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.