pub struct KnowledgePolicy {
pub candidates_max_files: Option<usize>,
pub candidate_max_age_minutes: Option<i64>,
}Expand description
knowledge: of the policy: the bounds on the review queue of derived knowledge records.
A candidate is a record the deriver wrote at an episode boundary and nobody has judged
(ADR 0091). The queue is measured, never emptied by a machine, and both numbers are
declared once in the policy and read from it by the shell validator and by
knowledge_base.candidates alike. Absence is carried as absence: a repository whose
policy predates the keys is reported as declaring no cap, never judged against one
nobody wrote down.
use majordomus_cli::policy::KnowledgePolicy;
let declared: KnowledgePolicy =
serde_json::from_str(r#"{"candidates_max_files": 40}"#).expect("a knowledge block");
assert_eq!(declared.candidates_max_files, Some(40));
assert_eq!(declared.candidate_max_age_minutes, None, "absent is absent, not a default");
assert_eq!(KnowledgePolicy::default().candidates_max_files, None);Fields§
§candidates_max_files: Option<usize>More records with status candidate than this awaiting review is a finding.
candidate_max_age_minutes: Option<i64>A candidate waiting longer than this since it entered the queue is a finding.
Trait Implementations§
Source§impl Clone for KnowledgePolicy
impl Clone for KnowledgePolicy
Source§fn clone(&self) -> KnowledgePolicy
fn clone(&self) -> KnowledgePolicy
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 KnowledgePolicy
impl Debug for KnowledgePolicy
Source§impl Default for KnowledgePolicy
impl Default for KnowledgePolicy
Source§fn default() -> KnowledgePolicy
fn default() -> KnowledgePolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for KnowledgePolicy
impl<'de> Deserialize<'de> for KnowledgePolicy
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
impl Eq for KnowledgePolicy
Source§impl PartialEq for KnowledgePolicy
impl PartialEq for KnowledgePolicy
Source§fn eq(&self, other: &KnowledgePolicy) -> bool
fn eq(&self, other: &KnowledgePolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for KnowledgePolicy
Auto Trait Implementations§
impl Freeze for KnowledgePolicy
impl RefUnwindSafe for KnowledgePolicy
impl Send for KnowledgePolicy
impl Sync for KnowledgePolicy
impl Unpin for KnowledgePolicy
impl UnsafeUnpin for KnowledgePolicy
impl UnwindSafe for KnowledgePolicy
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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.