pub struct ProductModel { /* private fields */ }Expand description
The validated product model and every index derived from it. Immutable: built once from an index and a registry, read many times.
Implementations§
Source§impl ProductModel
impl ProductModel
Sourcepub fn build(
index: &Index,
registry: &CapabilityRegistry,
why: &Catalogue,
web: &Topology,
) -> Self
pub fn build( index: &Index, registry: &CapabilityRegistry, why: &Catalogue, web: &Topology, ) -> Self
Build the model from an index, the registry its module references resolve against, the catalogue whose moments it answers, and the topology whose surfaces it names. Deterministic: the same objects produce the same value, and no derivation reads a clock.
Sourcepub fn module_area(&self, module: &str) -> Option<&str>
pub fn module_area(&self, module: &str) -> Option<&str>
The area a capability module serves, or None for a module no feature with an area
names.
Derived when the model is built, from the features that name the module, resolved by the areas’ own weight; the Cockpit’s sidebar groups by it. The derivation is private and this text does not link to it: rustdoc refuses a public link to a private item, and the public fact is the answer rather than the route to it.
Sourcepub fn all(&self) -> &[ResolvedRefs]
pub fn all(&self) -> &[ResolvedRefs]
Every feature, resolved, in presentation order, whatever its status.
Sourcepub fn feature(&self, id: &str) -> Option<&ResolvedRefs>
pub fn feature(&self, id: &str) -> Option<&ResolvedRefs>
One feature by id.
Sourcepub fn public(&self) -> Vec<&ResolvedRefs>
pub fn public(&self) -> Vec<&ResolvedRefs>
The stable features, in presentation order.
Sourcepub fn featured(&self) -> Vec<&ResolvedRefs>
pub fn featured(&self) -> Vec<&ResolvedRefs>
The stable features the homepage shows, in presentation order.
Sourcepub fn providers(&self) -> &[ProductProvider]
pub fn providers(&self) -> &[ProductProvider]
The providers the tool has an adapter for.
Sourcepub fn findings(&self) -> &[ProductFinding]
pub fn findings(&self) -> &[ProductFinding]
Every finding.
Sourcepub fn fingerprint(&self) -> &str
pub fn fingerprint(&self) -> &str
The hash of the model’s sources and derived facts.
Sourcepub fn module_coverage(&self) -> &[ProductCoverage]
pub fn module_coverage(&self) -> &[ProductCoverage]
Every module of the executable with the stable features that name it.
Sourcepub fn command_coverage(&self) -> &[ProductCoverage]
pub fn command_coverage(&self) -> &[ProductCoverage]
Every public shell command with the stable features that name it.
Sourcepub fn kind_coverage(&self) -> &[ProductCoverage]
pub fn kind_coverage(&self) -> &[ProductCoverage]
Every kind of the layer with the stable features that name it.
Sourcepub fn domains(&self) -> &[ResolvedDomain]
pub fn domains(&self) -> &[ResolvedDomain]
Every domain, resolved, in presentation order, whatever its status.
Sourcepub fn domain(&self, id: &str) -> Option<&ResolvedDomain>
pub fn domain(&self, id: &str) -> Option<&ResolvedDomain>
One domain by its id, whatever its status, or None when the layer declares no domain
of that id.
use majordomus_cli::product::ProductModel;
let empty = ProductModel::default();
assert!(empty.domain("context").is_none());Sourcepub fn public_domains(&self) -> Vec<&ResolvedDomain>
pub fn public_domains(&self) -> Vec<&ResolvedDomain>
The stable domains, in presentation order: the set every public surface shows, before it drops a domain no stable feature names.
use majordomus_cli::product::ProductModel;
assert!(ProductModel::default().public_domains().is_empty());Trait Implementations§
Source§impl Clone for ProductModel
impl Clone for ProductModel
Source§fn clone(&self) -> ProductModel
fn clone(&self) -> ProductModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more