Struct cargo::util::DependencyQueue [−][src]
Implementations
impl<N: Hash + Eq, E: Hash + Eq, V> DependencyQueue<N, E, V>
[src]
pub fn new() -> DependencyQueue<N, E, V>
[src]
Creates a new dependency queue with 0 packages.
impl<N: Hash + Eq + Clone, E: Eq + Hash + Clone, V> DependencyQueue<N, E, V>
[src]
pub fn queue(
&mut self,
key: N,
value: V,
dependencies: impl IntoIterator<Item = (N, E)>
)
[src]
&mut self,
key: N,
value: V,
dependencies: impl IntoIterator<Item = (N, E)>
)
Adds a new ndoe and its dependencies to this queue.
The key
specified is a new node in the dependency graph, and the node
depend on all the dependencies iterated by dependencies
. Each
dependency is a node/edge pair, where edges can be thought of as
productions from nodes (aka if it’s just ()
it’s just waiting for the
node to finish).
An optional value
can also be associated with key
which is reclaimed
when the node is ready to go.
pub fn queue_finished(&mut self)
[src]
All nodes have been added, calculate some internal metadata and prepare
for dequeue
.
pub fn dequeue(&mut self) -> Option<(N, V)>
[src]
Dequeues a package that is ready to be built.
A package is ready to be built when it has 0 un-built dependencies. If
None
is returned then no packages are ready to be built.
pub fn is_empty(&self) -> bool
[src]
Returns true
if there are remaining packages to be built.
pub fn len(&self) -> usize
[src]
Returns the number of remaining packages to be built.
pub fn finish(&mut self, node: &N, edge: &E) -> Vec<&N>
[src]
Indicate that something has finished.
Calling this function indicates that the node
has produced edge
. All
remaining work items which only depend on this node/edge pair are now
candidates to start their job.
Returns the nodes that are now allowed to be dequeued as a result of finishing this node.
Trait Implementations
impl<N: Debug + Hash + Eq, E: Debug + Hash + Eq, V: Debug> Debug for DependencyQueue<N, E, V>
[src]
impl<N: Hash + Eq, E: Hash + Eq, V> Default for DependencyQueue<N, E, V>
[src]
fn default() -> DependencyQueue<N, E, V>
[src]
Auto Trait Implementations
impl<N, E, V> RefUnwindSafe for DependencyQueue<N, E, V> where
E: RefUnwindSafe,
N: RefUnwindSafe,
V: RefUnwindSafe,
E: RefUnwindSafe,
N: RefUnwindSafe,
V: RefUnwindSafe,
impl<N, E, V> Send for DependencyQueue<N, E, V> where
E: Send,
N: Send,
V: Send,
E: Send,
N: Send,
V: Send,
impl<N, E, V> Sync for DependencyQueue<N, E, V> where
E: Sync,
N: Sync,
V: Sync,
E: Sync,
N: Sync,
V: Sync,
impl<N, E, V> Unpin for DependencyQueue<N, E, V> where
E: Unpin,
N: Unpin,
V: Unpin,
E: Unpin,
N: Unpin,
V: Unpin,
impl<N, E, V> UnwindSafe for DependencyQueue<N, E, V> where
E: UnwindSafe,
N: UnwindSafe,
V: UnwindSafe,
E: UnwindSafe,
N: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,