[−][src]Struct depmap::DepMap
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]
F: FnMut(&T) -> I,
I: Iterator<Item = Result<T, E>>,
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]
F: FnOnce(&T) -> I,
I: Iterator<Item = Result<T, E>>,
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
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,