[−][src]Function futures_ext::bounded_traversal::bounded_traversal_stream
pub fn bounded_traversal_stream<In, InsInit, Ins, Out, Unfold, UFut>(
scheduled_max: usize,
init: InsInit,
mut unfold: Unfold
) -> impl Stream<Item = Out, Error = UFut::Error> where
Unfold: FnMut(In) -> UFut,
UFut: IntoFuture<Item = (Out, Ins)>,
InsInit: IntoIterator<Item = In>,
Ins: IntoIterator<Item = In>,
bounded_traversal_stream
traverses implicit asynchronous tree specified by init
and unfold
arguments. All unfold
operations are executed in parallel if they
do not depend on each other (not related by ancestor-descendant relation in implicit
tree) with amount of concurrency constrained by scheduled_max
. Main difference
with bounded_traversal
is that this one is not structure perserving, and returns
stream.
init: InsInit
Is the root(s) of the implicit tree to be traversed
unfold: FnMut(In) -> impl IntoFuture<Item = (Out, impl IntoIterator<Item = In>)>
Asynchronous function which given input value produces list of its children and output value.
return value impl Stream<Item = Out>
Stream of all Out
values