[][src]Struct cargo::util::DependencyQueue

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

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]

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.

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]

Auto Trait Implementations

impl<N, E, V> RefUnwindSafe for DependencyQueue<N, E, V> where
    E: RefUnwindSafe,
    N: RefUnwindSafe,
    V: RefUnwindSafe

impl<N, E, V> Send for DependencyQueue<N, E, V> where
    E: Send,
    N: Send,
    V: Send

impl<N, E, V> Sync for DependencyQueue<N, E, V> where
    E: Sync,
    N: Sync,
    V: Sync

impl<N, E, V> Unpin for DependencyQueue<N, E, V> where
    E: Unpin,
    N: Unpin,
    V: Unpin

impl<N, E, V> UnwindSafe for DependencyQueue<N, E, V> where
    E: UnwindSafe,
    N: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,