pub struct CapacityCalculation {Show 13 fields
pub scope: CapacityScope,
pub capacity: Option<u64>,
pub unit: Option<String>,
pub committed: Option<u64>,
pub completed: Option<u64>,
pub remaining: Option<u64>,
pub overflow: Option<u64>,
pub utilization: Option<u32>,
pub counted_issues: Option<u32>,
pub uncounted_issues: Option<u32>,
pub unestimated_issues: Option<u32>,
pub source: CapacitySource,
pub diagnostics: Vec<CapacityWarning>,
}Expand description
The shared derived result for one scope (data-model §4, T013).
Every derived field is None exactly when the calculation could not run; see the
module docs for the rule. The DTO is read-only by construction: it holds no store, no
root and no writer, so the same value that a CLI prints is the one an MCP tool returns
and the one portable output serializes (C-007).
Fields§
§scope: CapacityScopeThe scope the numbers describe.
capacity: Option<u64>The ceiling in force, or None when no capacity entry applies: unconfigured is
not a zero ceiling.
unit: Option<String>The unit every number is counted in, from the capacity entry. None when the
scope is unconfigured — a capacity with no unit cannot be calculated (C-004).
committed: Option<u64>The sum of the valid, converted estimates in scope. None when nothing could be
counted; Some(0) only when the scope was counted and holds no counted work.
completed: Option<u64>The committed part whose issues the shared completion service calls complete
(T015). Always <= committed: it is the same per-issue numbers over a subset.
remaining: Option<u64>committed - completed. None exactly when those are.
overflow: Option<u64>max(committed - capacity, 0). None when either input is unknown; Some(0) at
or under the ceiling, because a scope exactly at its ceiling is not over it.
utilization: Option<u32>committed as a floored whole percentage of capacity — the one rounding policy
(C-007). None when no ceiling is configured or the ceiling is 0, where the
ratio has no value; never 0 standing in for “unknown”.
counted_issues: Option<u32>Issues whose estimate was counted into committed.
uncounted_issues: Option<u32>Issues that state an estimate which could not be counted in the unit; each has a diagnostic naming it. They contribute nothing to the sums.
unestimated_issues: Option<u32>Issues that state no estimate at all. Visible, never zero, and never an error — stating nothing is not a mistake (C-005, data-model §3).
source: CapacitySourceThe snapshot the numbers came from.
diagnostics: Vec<CapacityWarning>The findings, in derivation order: about the scope itself, then about its members in issue order, then about the total derived from them (T017).
Implementations§
Source§impl CapacityCalculation
impl CapacityCalculation
Sourcepub fn for_scope(
snapshot: &IssueSnapshot,
index: &ScheduleIndex,
config: &Config,
scope: CapacityScope,
) -> Self
pub fn for_scope( snapshot: &IssueSnapshot, index: &ScheduleIndex, config: &Config, scope: CapacityScope, ) -> Self
Calculate one scope from an already-built snapshot.
index is the ScheduleIndex snapshot was built with (a cycle reference
resolves through it), and config is the project configuration that snapshot was
built under: the snapshot’s conversion table includes every unit config.capacity
declares, and the ceiling and unit come from the entry that targets scope. A
reference is matched on the identity super::config::validate keys a ceiling by
— never on the text — so @ada for ada and a generated cycle’s stable id for its
name are one scope.
Nothing is mutated, and nothing outside the snapshot is read: the issues are already indexed, and this walks the scope’s membership list once, in issue order.
Sourcepub fn state(&self) -> CapacityState
pub fn state(&self) -> CapacityState
Whether this calculation had a ceiling it could count against (T016).
The explicit no-capacity state: a scope with no entry, or with an entry that is not
in force, is CapacityState::Unconfigured rather than a scope with zero capacity.
Sourcepub fn is_over_capacity(&self) -> bool
pub fn is_over_capacity(&self) -> bool
Whether the scope is over its ceiling.
The one predicate a surface asks instead of comparing overflow itself, so “over
capacity” means one thing everywhere.
Trait Implementations§
Source§impl Clone for CapacityCalculation
impl Clone for CapacityCalculation
Source§impl Debug for CapacityCalculation
impl Debug for CapacityCalculation
Source§impl Default for CapacityCalculation
impl Default for CapacityCalculation
impl Eq for CapacityCalculation
Source§impl PartialEq for CapacityCalculation
impl PartialEq for CapacityCalculation
impl StructuralPartialEq for CapacityCalculation
Auto Trait Implementations§
impl Freeze for CapacityCalculation
impl RefUnwindSafe for CapacityCalculation
impl Send for CapacityCalculation
impl Sync for CapacityCalculation
impl Unpin for CapacityCalculation
impl UnsafeUnpin for CapacityCalculation
impl UnwindSafe for CapacityCalculation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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