[][src]Struct depmap::DepMap

pub struct DepMap<T: PartialEq> { /* fields omitted */ }

The dependency map.

Methods

impl<T: PartialEq> DepMap<T>[src]

pub fn new(list: Vec<T>) -> Self[src]

Creates a new DepMap from an initial list.

pub fn process<F, I, E>(initial: Vec<T>, f: F) -> Result<Vec<T>, Error<T, E>> where
    F: FnMut(&T) -> I,
    I: Iterator<Item = Result<T, E>>, 
[src]

Runs through a whole dependency map using a single producer function.

This is probably what one should use.

pub fn is_empty(&self) -> bool[src]

Whether the map is empty (i.e nothing needs to be worked on).

pub fn destroy(self) -> Result<Vec<T>, Self>[src]

Returns the result list if the dependency map is empty.

If it is not empty, then an error is returned with the whole map.

pub fn add<F, I, E>(&mut self, f: F) -> Result<Option<Vec<&T>>, E> where
    F: FnOnce(&T) -> I,
    I: Iterator<Item = Result<T, E>>, 
[src]

Adds the latest target's dependencies at the end, removing those already done and returning cyclic dependency errors (if any).

When cyclic dependency errors occur, the target is retained but its dependencies are not. Skips everything if the depmap is empty.

Auto Trait Implementations

impl<T> Send for DepMap<T> where
    T: Send

impl<T> Sync for DepMap<T> where
    T: Sync

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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<T> Any for T where
    T: 'static + ?Sized
[src]