Skip to main content

CategoryResolution

Struct CategoryResolution 

Source
pub struct CategoryResolution {
    pub unmapped: Vec<String>,
    pub default_applied: bool,
    pub explicit_policy: bool,
    pub board: String,
    /* private fields */
}
Expand description

The built once-per-load derivation from column name to category (data-model.md §3).

Fields§

§unmapped: Vec<String>

Configured columns that resolved by the safe default rather than by an explicit mapping, in board order.

Recorded so a surface can report unmapped_column_default “where ambiguity matters”. A column silently defaulting is the thing the contract is most careful about, and it cannot be reported from the map alone.

§default_applied: bool

Whether any column relied on the default. Lets a caller skip the diagnostic entirely on a fully-mapped board.

§explicit_policy: bool

Whether the board declared a category_map, as opposed to resolving every column through the safe default.

WP03. This is the signal that separates a board whose author described its categories from one that never did, and it is what gates the terminal lock. Without it, WP01’s legacy reconciliation (done_column resolves to completed so completion detection works, FR-003) would silently hand every existing repository a transition policy it never configured: moving an issue back out of done would start failing on every board in the wild, and on the TUI there is no flag or key to override it with for two more work packages.

Deliberately distinct from Self::default_applied: a board may declare a category_map and still leave some columns to the default, so default_applied is “some column is unmapped” while this is “a map was written at all”. The lock is about intent, and intent is expressed by the presence of the section.

Note the consequence, since it is a real one: a legacy board gets the completion definition and the commit-clearing rule, but not the terminal lock. Those are different things — completion answers “is this done?”, the lock answers “may this move?” — and the contract treats them in different sections for that reason.

§board: String

The board’s name, for diagnostics.

Implementations§

Source§

impl CategoryResolution

Source

pub fn resolve(&self, column: &str) -> Option<WorkflowCategory>

The category column resolves to, or None for a column this board does not configure.

A hash lookup. A caller that needs to distinguish “not configured” from “configured but defaulted” uses Self::unmapped.

Source

pub fn columns(&self) -> impl Iterator<Item = &str>

Every column this board configures, in board order.

Reads Self::order, not by_column, so the sequence is the board’s own declaration order and is the same on every run (see the field’s note).

Source

pub fn column_list(&self) -> String

The board’s columns joined for a message, in board order.

WP03. A unknown_column refusal is the one diagnostic a user reads to work out what to type instead, so it must list the valid columns. Rendering that list in one place keeps every unknown_column message agreeing on it.

Source

pub fn has_completion(&self) -> bool

Whether any column resolves to completed.

Trait Implementations§

Source§

impl Clone for CategoryResolution

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 CategoryResolution

Source§

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

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

impl Eq for CategoryResolution

Source§

impl PartialEq for CategoryResolution

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 CategoryResolution

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.