pub struct ReferenceTargets {
pub projects: HashSet<String>,
pub milestones: HashSet<String>,
pub cycles: HashSet<String>,
}Expand description
The resolvable targets of one snapshot, consumed from their owners.
This module performs no file I/O: the sets are plain in-memory collections, so
a caller with a fixture — a unit test, or a surface that already resolved them
— builds one directly. ReferenceTargets::from_planner is the optional
production adapter: it consumes the existing lookups, including
Planner::milestone_names(), which is filesystem-backed, plus
Planner::cycle_names() and the implicit Default cycle Planner::cycle()
answers for, and the project registry for project ids. No second milestone or
cycle store exists (research R2).
Each set is a HashSet, so a lookup is a hash probe rather than a scan: with
E epics and p references each, resolve_references stays one pass over the
issues plus one pass over the registry (contract §7, NFR-001).
Fields§
§projects: HashSet<String>Project ids the project registry holds, as the registry keys them.
milestones: HashSet<String>Milestone names the milestone registry holds.
cycles: HashSet<String>Cycle names the cycle registry answers for.
Implementations§
Source§impl ReferenceTargets
impl ReferenceTargets
Sourcepub fn from_planner(planner: &Planner) -> Result<Self>
pub fn from_planner(planner: &Planner) -> Result<Self>
Consume the existing planning lookups for one Planner.
This is the production adapter: milestones come from
Planner::milestone_names and cycles from Planner::cycle_names plus
the implicit Default cycle Planner::cycle answers for even when no
file holds it. Both sets are built once here, so the diagnosis below is a
probe per reference rather than a scan per reference.
Sourcepub fn project_known(&self, id: &str) -> bool
pub fn project_known(&self, id: &str) -> bool
Whether the project registry holds id.
Sourcepub fn milestone_known(&self, name: &str) -> bool
pub fn milestone_known(&self, name: &str) -> bool
Whether the milestone registry holds name.
Sourcepub fn cycle_known(&self, name: &str) -> bool
pub fn cycle_known(&self, name: &str) -> bool
Whether the cycle registry answers for name.
Trait Implementations§
Source§impl Clone for ReferenceTargets
impl Clone for ReferenceTargets
Source§impl Debug for ReferenceTargets
impl Debug for ReferenceTargets
Source§impl Default for ReferenceTargets
impl Default for ReferenceTargets
impl Eq for ReferenceTargets
Source§impl PartialEq for ReferenceTargets
impl PartialEq for ReferenceTargets
impl StructuralPartialEq for ReferenceTargets
Auto Trait Implementations§
impl Freeze for ReferenceTargets
impl RefUnwindSafe for ReferenceTargets
impl Send for ReferenceTargets
impl Sync for ReferenceTargets
impl Unpin for ReferenceTargets
impl UnsafeUnpin for ReferenceTargets
impl UnwindSafe for ReferenceTargets
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