pub struct DependencyGraph { /* private fields */ }Expand description
A blocker edge points from the prerequisite to the issue waiting on it.
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn from_issues(issues: &[(String, IssueHeading)]) -> Result<Self>
pub fn from_issues(issues: &[(String, IssueHeading)]) -> Result<Self>
Build a graph and reject malformed duplicate IDs or cyclic dependencies.
§Errors
Returns an error if two headings share an id, an issue blocks itself, or the blocker edges form a cycle.
Sourcepub fn from_headings<'a, I>(issues: I) -> Result<Self>where
I: IntoIterator<Item = &'a IssueHeading>,
pub fn from_headings<'a, I>(issues: I) -> Result<Self>where
I: IntoIterator<Item = &'a IssueHeading>,
Same graph as Self::from_issues, without copying headings.
§Errors
Returns an error if two headings share an id, an issue blocks itself, or the blocker edges form a cycle.
Sourcepub fn accepts_edge(&self, blocker: &str, issue: &str) -> Result<(), Error>
pub fn accepts_edge(&self, blocker: &str, issue: &str) -> Result<(), Error>
Validate a prospective blocker insertion without mutating the graph.
Unknown ids are accepted: a missing endpoint is not a cycle.
§Errors
Returns an error if blocker is issue, or if adding the edge would
close a loop.
Sourcepub fn topological_ids(&self) -> Result<Vec<String>>
pub fn topological_ids(&self) -> Result<Vec<String>>
Return a deterministic prerequisite-first order.
§Errors
Returns an error if the graph contains a cycle.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DependencyGraph
impl RefUnwindSafe for DependencyGraph
impl Send for DependencyGraph
impl Sync for DependencyGraph
impl Unpin for DependencyGraph
impl UnsafeUnpin for DependencyGraph
impl UnwindSafe for DependencyGraph
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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