pub struct SubjectEntry {
pub kind: SubjectKind,
pub id: String,
pub status: Option<String>,
pub page: Option<String>,
pub alias_of: Option<String>,
pub programs: Vec<Program>,
pub members: Vec<String>,
pub routes: Vec<Route>,
pub mechanisms: Vec<String>,
pub findings: Vec<SubjectFinding>,
}Expand description
One subject of the index: what it is, what it is made of and the tests it reaches.
use majordomus_cli::evidence::subject::{self, SubjectEntry, SubjectKind};
use majordomus_cli::synthetic::SyntheticRepository;
let repo = SyntheticRepository::small().unwrap();
let ctx = repo.context().unwrap();
let s = subject::index(&ctx.index, &ctx.product, &ctx.registry);
let entry: &SubjectEntry = s.get("capability:capabilities.list").unwrap();
assert_eq!(entry.kind, SubjectKind::Capability);
assert_eq!(entry.page.as_deref(), Some("/evidence/capabilities/capabilities-list/"));
assert!(entry.members.contains(&"command:capabilities list".to_string()));
assert!(entry.programs.is_empty(), "only a command names its programs");Fields§
§kind: SubjectKindWhat kind of declaration it is.
id: StringIts id within the kind.
status: Option<String>The status its declaration states: a claim, a rule, a feature or a use case.
page: Option<String>Its page on the site: /evidence/<section>/<slug>/.
alias_of: Option<String>The capability an MCP tool is an alias of.
programs: Vec<Program>The programs a command word belongs to, in declaration order; empty for every other kind.
members: Vec<String>The subjects it is made of, by key, unique, in byte order.
routes: Vec<Route>Its own routes, in (via, test, path) order.
mechanisms: Vec<String>A rule’s named paths that no runner drives.
findings: Vec<SubjectFinding>Its structural findings.
Trait Implementations§
Source§impl Clone for SubjectEntry
impl Clone for SubjectEntry
Source§fn clone(&self) -> SubjectEntry
fn clone(&self) -> SubjectEntry
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 SubjectEntry
impl Debug for SubjectEntry
Source§impl<'de> Deserialize<'de> for SubjectEntry
impl<'de> Deserialize<'de> for SubjectEntry
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 SubjectEntry
Source§impl PartialEq for SubjectEntry
impl PartialEq for SubjectEntry
Source§fn eq(&self, other: &SubjectEntry) -> bool
fn eq(&self, other: &SubjectEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SubjectEntry
impl Serialize for SubjectEntry
impl StructuralPartialEq for SubjectEntry
Auto Trait Implementations§
impl Freeze for SubjectEntry
impl RefUnwindSafe for SubjectEntry
impl Send for SubjectEntry
impl Sync for SubjectEntry
impl Unpin for SubjectEntry
impl UnsafeUnpin for SubjectEntry
impl UnwindSafe for SubjectEntry
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.