Skip to main content

ProductModel

Struct ProductModel 

Source
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

Source

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.

Source

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.

Source

pub fn all(&self) -> &[ResolvedRefs]

Every feature, resolved, in presentation order, whatever its status.

Source

pub fn feature(&self, id: &str) -> Option<&ResolvedRefs>

One feature by id.

Source

pub fn public(&self) -> Vec<&ResolvedRefs>

The stable features, in presentation order.

Source

pub fn featured(&self) -> Vec<&ResolvedRefs>

The stable features the homepage shows, in presentation order.

Source

pub fn providers(&self) -> &[ProductProvider]

The providers the tool has an adapter for.

Source

pub fn findings(&self) -> &[ProductFinding]

Every finding.

Source

pub fn errors(&self) -> usize

How many findings are errors.

Source

pub fn fingerprint(&self) -> &str

The hash of the model’s sources and derived facts.

Source

pub fn module_coverage(&self) -> &[ProductCoverage]

Every module of the executable with the stable features that name it.

Source

pub fn command_coverage(&self) -> &[ProductCoverage]

Every public shell command with the stable features that name it.

Source

pub fn kind_coverage(&self) -> &[ProductCoverage]

Every kind of the layer with the stable features that name it.

Source

pub fn domains(&self) -> &[ResolvedDomain]

Every domain, resolved, in presentation order, whatever its status.

Source

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());
Source

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

Source§

fn clone(&self) -> ProductModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProductModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProductModel

Source§

fn default() -> ProductModel

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more