pub struct Skills {
pub skills: Vec<SkillStatus>,
pub findings: Vec<SkillFinding>,
}Expand description
Every skill of a repository, derived, and every finding.
use majordomus_cli::evidence::Ledger;
use majordomus_cli::skill::Skills;
use majordomus_cli::synthetic::SyntheticRepository;
let repo = SyntheticRepository::small().unwrap();
let skills = Skills::build(&repo.index().unwrap(), &Ledger::empty());
assert!(skills.skill("no-such-skill").is_none());Fields§
§skills: Vec<SkillStatus>Every skill, in index order.
findings: Vec<SkillFinding>Every finding: each skill’s, then those about no one skill (a binding to nothing).
Implementations§
Source§impl Skills
impl Skills
Sourcepub fn build(index: &Index, ledger: &Ledger) -> Skills
pub fn build(index: &Index, ledger: &Ledger) -> Skills
Derive every skill’s standing from the index, the evidence ledger, the tracked tests, the tracked invocation surfaces and the CI model.
use majordomus_cli::evidence::Ledger;
use majordomus_cli::skill::Skills;
use majordomus_cli::synthetic::SyntheticRepository;
let repo = SyntheticRepository::small().unwrap();
let a = Skills::build(&repo.index().unwrap(), &Ledger::empty());
let b = Skills::build(&repo.index().unwrap(), &Ledger::empty());
assert_eq!(a, b, "two reads of one tree derive the same answer");Sourcepub fn skill(&self, id: &str) -> Option<&SkillStatus>
pub fn skill(&self, id: &str) -> Option<&SkillStatus>
One skill by id, the directory name under .ai/repo/skills/; None only when the
repository has no skill of that name, since one the index refused is still listed,
standing invalid.
use majordomus_cli::skill::Skills;
let empty = Skills { skills: vec![], findings: vec![] };
assert!(empty.skill("implement").is_none());Sourcepub fn failures(&self) -> usize
pub fn failures(&self) -> usize
How many findings refuse: skills verify is valid only when this is zero. Warnings
are counted apart, by Skills::warnings, and never make it invalid.
use majordomus_cli::skill::Skills;
assert_eq!(Skills { skills: vec![], findings: vec![] }.failures(), 0);Sourcepub fn warnings(&self) -> usize
pub fn warnings(&self) -> usize
How many findings are warnings: debts a skill still owes that do not refuse the
verdict, such as a partial standing. Refusals are counted by Skills::failures.
use majordomus_cli::skill::Skills;
assert_eq!(Skills { skills: vec![], findings: vec![] }.warnings(), 0);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Skills
impl<'de> Deserialize<'de> for Skills
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>,
impl Eq for Skills
Source§impl JsonSchema for Skills
impl JsonSchema for Skills
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for Skills
Auto Trait Implementations§
impl Freeze for Skills
impl RefUnwindSafe for Skills
impl Send for Skills
impl Sync for Skills
impl Unpin for Skills
impl UnsafeUnpin for Skills
impl UnwindSafe for Skills
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
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
key and return true if they are equal.