pub struct CapacityEntry {
pub cycle: Option<String>,
pub team: Option<String>,
pub assignee: Option<String>,
pub capacity: Option<i64>,
pub unit: Option<String>,
pub enabled: bool,
pub extensions: CapacityExtensions,
}Expand description
One capacity ceiling, for exactly one scope.
The three scope keys are Option<String> on purpose: “absent” has to be
distinguishable from “set”, because an entry that names no scope is refused by name
(C-003) rather than guessed from the surrounding table. capacity is i64 rather
than an unsigned integer so that a negative number is refused with its field path
instead of failing in the TOML parser, where no diagnostic could name the record.
Fields§
§cycle: Option<String>The cycle this ceiling belongs to: the name a [cycles.<name>] record answers
to, or a generated cycle’s stable id. See resolve_cycle.
team: Option<String>The team this ceiling belongs to: a [teams.<label>] key.
assignee: Option<String>The assignee this ceiling belongs to: an identity in the shape an issue’s
assignee field tolerates (a handle, or Name <email>).
capacity: Option<i64>The ceiling itself, at or above zero, counted in unit.
Required for an enabled entry; a disabled entry may omit it, which is how a scope stays configured without a ceiling in force.
unit: Option<String>The estimate unit capacity counts in. Required for an enabled
entry, refused when blank, and refused when no board declares it.
enabled: boolWhether the ceiling is in force. false keeps the numbers for later without
changing today’s calculations.
extensions: CapacityExtensionsUnknown metadata, preserved verbatim.
Implementations§
Source§impl CapacityEntry
impl CapacityEntry
Sourcepub fn scopes(&self) -> impl Iterator<Item = (CapacityScopeKind, &str)>
pub fn scopes(&self) -> impl Iterator<Item = (CapacityScopeKind, &str)>
The (kind, reference) this entry names, in scope-kind order.
Zero entries means “no scope”, more than one means “ambiguous”; both are refused
by validate. A caller that has validated a config always gets exactly one.
Sourcepub fn scope_kind(&self) -> Option<CapacityScopeKind>
pub fn scope_kind(&self) -> Option<CapacityScopeKind>
The scope kind this entry names, when it names exactly one.
Sourcepub fn scope_id(&self) -> Option<&str>
pub fn scope_id(&self) -> Option<&str>
The scope reference this entry names, when it names exactly one.
Sourcepub fn effective(&self) -> bool
pub fn effective(&self) -> bool
Whether the ceiling is in force: enabled, with a value and a unit.
The resolver every surface should ask, so “declared but disabled” cannot be read
as “enforced” by one caller and not another — the same rule
crate::wip::config::WipConfig::effective_limit follows for limits.
Trait Implementations§
Source§impl Clone for CapacityEntry
impl Clone for CapacityEntry
Source§impl Debug for CapacityEntry
impl Debug for CapacityEntry
Source§impl Default for CapacityEntry
impl Default for CapacityEntry
Source§impl<'de> Deserialize<'de> for CapacityEntrywhere
CapacityEntry: Default,
impl<'de> Deserialize<'de> for CapacityEntrywhere
CapacityEntry: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for CapacityEntry
Source§impl PartialEq for CapacityEntry
impl PartialEq for CapacityEntry
Source§impl Serialize for CapacityEntry
impl Serialize for CapacityEntry
impl StructuralPartialEq for CapacityEntry
Auto Trait Implementations§
impl Freeze for CapacityEntry
impl RefUnwindSafe for CapacityEntry
impl Send for CapacityEntry
impl Sync for CapacityEntry
impl Unpin for CapacityEntry
impl UnsafeUnpin for CapacityEntry
impl UnwindSafe for CapacityEntry
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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