pub struct TopoGroupedGraph<N, ID, S, F> { /* private fields */ }Expand description
Graph iterator adapter builder to group topological branches.
Basic idea is DFS from the heads. At fork point, the other descendant branches will be visited. At merge point, the second (or the last) ancestor branch will be visited first. This is practically the same as Git.
If no branches are prioritized, the branch containing the first commit in the input iterator will be emitted first. It is often the working-copy ancestor branch. The other head branches won’t be enqueued eagerly, and will be emitted as late as possible.
Implementations§
Source§impl<N, ID, E, S, F> TopoGroupedGraph<N, ID, S, F>
impl<N, ID, E, S, F> TopoGroupedGraph<N, ID, S, F>
Sourcepub fn new(input_stream: S, as_id: F) -> Self
pub fn new(input_stream: S, as_id: F) -> Self
Wraps the given iterator to group topological branches. The input iterator must be topologically ordered.
Sourcepub fn prioritize_branch(&mut self, id: ID)
pub fn prioritize_branch(&mut self, id: ID)
Makes the branch containing the specified node be emitted earlier than the others.
The id usually points to a head node, but this isn’t a requirement.
If the specified node isn’t a head, all preceding nodes will be queued.
The specified node must exist in the input iterator. If it didn’t, the iterator would panic.
Trait Implementations§
Source§impl<N: Clone, ID: Clone, S: Clone, F: Clone> Clone for TopoGroupedGraph<N, ID, S, F>
impl<N: Clone, ID: Clone, S: Clone, F: Clone> Clone for TopoGroupedGraph<N, ID, S, F>
Source§fn clone(&self) -> TopoGroupedGraph<N, ID, S, F>
fn clone(&self) -> TopoGroupedGraph<N, ID, S, F>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<N, ID, S, F> Freeze for TopoGroupedGraph<N, ID, S, F>
impl<N, ID, S, F> RefUnwindSafe for TopoGroupedGraph<N, ID, S, F>
impl<N, ID, S, F> Send for TopoGroupedGraph<N, ID, S, F>
impl<N, ID, S, F> Sync for TopoGroupedGraph<N, ID, S, F>
impl<N, ID, S, F> Unpin for TopoGroupedGraph<N, ID, S, F>
impl<N, ID, S, F> UnsafeUnpin for TopoGroupedGraph<N, ID, S, F>where
S: UnsafeUnpin,
F: UnsafeUnpin,
impl<N, ID, S, F> UnwindSafe for TopoGroupedGraph<N, ID, S, F>
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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