Skip to main content

ProjectIndex

Struct ProjectIndex 

Source
pub struct ProjectIndex { /* private fields */ }
Expand description

The derived project view over one snapshot of issues and the registry.

Built once and read many times. The bucket map is the NFR-001 index; the project map is IndexMap so declaration order is the display order; the label/status maps carry what a member listing needs. Nothing here is stored.

Implementations§

Source§

impl ProjectIndex

Source

pub fn build<N: ProjectNode>(config: &Config, issues: &[N]) -> Self

Build the index in one pass over the issue set.

An association whose project does not resolve is kept in Self::missing rather than dropped: a silently absent reference is the failure C-005 forbids, and validate_references reports exactly this set.

Source

pub fn buckets(&self) -> &HashMap<ProjectId, Vec<IssueKey>>

The reverse index, as the contract spells it.

Source

pub fn bucket(&self, id: &ProjectId) -> Option<&[IssueKey]>

The member keys of one project.

None only for a project the registry does not hold. A known project with no members returns an empty slice, so “not a project” and “a project with no members yet” stay distinguishable to a caller.

Source

pub fn projects(&self) -> Vec<&Project>

Projects in declaration order.

Source

pub fn project(&self, id: &ProjectId) -> Option<&Project>

One project by id.

Source

pub fn label(&self, key: IssueKey) -> Option<&str>

The issue display label the index recorded.

Source

pub fn status_of(&self, key: IssueKey) -> Option<&str>

An issue’s status, as the index recorded it.

Source

pub fn missing(&self) -> &[MissingProjectReference]

The diagnosed associations of this snapshot.

Source

pub fn resolve(&self, reference: &str) -> Result<&Project, ProjectError>

Resolve a project by id (first) or by name.

Source

pub fn membership( &self, reference: &str, ) -> Result<ProjectMembership, ProjectError>

The ordered membership of a project.

Source

pub fn resolved_memberships(&self) -> HashMap<u32, Vec<String>>

Every issue’s resolved project ids, in registry declaration order.

The reverse of Self::buckets: issue number -> the ids of the projects that hold it. Derived from the same buckets, so a grouping surface cannot disagree with Self::membership about who is a member; an association the registry does not hold appears in no bucket and therefore in no entry here (it is diagnosed by validate_references instead — the chosen asymmetry tix search’s project_matches documents).

Declaration order is the display order, so project_bucket_label over an entry is the same label the board’s ProjectPartition produces.

Source

pub fn into_buckets(self) -> HashMap<ProjectId, Vec<IssueKey>>

Consume the index into its reverse map (the contract’s return shape).

Source

pub fn into_missing(self) -> Vec<MissingProjectReference>

Consume the index into its missing-reference list.

Source

pub fn into_projects(self) -> Vec<Project>

Consume the index into its declaration-ordered project list.

Source§

impl ProjectIndex

Source

pub fn health<S: BuildHasher>( &self, config: &Config, reference: &str, assigned: &HashSet<u32, S>, overdue: &HashSet<u32, S>, blocked: &HashSet<u32, S>, ) -> Result<ProjectHealthReport, ProjectError>

Progress and health for one project (contract §1, FR-003).

Reads the members from the index’s bucket, so a project’s figures are a bucket lookup rather than a scan of the issue set (contract §4).

assigned, overdue, and blocked are the consumed derived facts, keyed by issue number and each produced by its owner: assigned_keys, the planning overdue read, and the relationship graph’s blocked_state. Project health counts them and never recomputes them. Completion resolves through the board’s configured completion column via the service resolution, never a literal "done".

A done issue is never counted as overdue, matching the planner’s own overdue rule: the passed set is normally already filtered, and the guard keeps the invariant true for any caller that passes a raw set.

Trait Implementations§

Source§

impl Clone for ProjectIndex

Source§

fn clone(&self) -> Self

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 ProjectIndex

Source§

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

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

impl Eq for ProjectIndex

Source§

impl PartialEq for ProjectIndex

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ProjectIndex

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
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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.