pub struct DependencyQueue<N: Hash + Eq, E: Hash + Eq, V> { /* private fields */ }

Implementations

Creates a new dependency queue with 0 packages.

Adds a new node 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.

The cost parameter can be used to hint at the relative cost of building this node. This implementation does not care about the units of this value, so the calling code is free to use whatever they’d like. In general, higher cost nodes are expected to take longer to build.

All nodes have been added, calculate some internal metadata and prepare for dequeue.

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.

Returns true if there are remaining packages to be built.

Returns the number of remaining packages to be built.

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

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.