pub struct BalancedSelector<I, O> { /* private fields */ }
Expand description
Equally selects from N nodes that all take in the same input and give the same output
§Example
use dataflow::prelude::*;
// Combine two file loading pipelines together, each taking Vec<()> as input and outputting Vec<(PathBuf, Vec<u8>)>
let combined_pipe = BalancedSelector::default()
.add_node(FileLoader::new(vec!["file1".into()]))
.add_node(FileLoader::new(vec!["file2".into()]).map(|(path, file)| {
// Per-pipeline processing here
(path, file)
}));
Implementations§
Trait Implementations§
Source§impl<I: Default, O: Default> Default for BalancedSelector<I, O>
impl<I: Default, O: Default> Default for BalancedSelector<I, O>
Source§fn default() -> BalancedSelector<I, O>
fn default() -> BalancedSelector<I, O>
Returns the “default value” for a type. Read more
Source§impl<I, O> Node<Vec<I>> for BalancedSelector<I, O>
impl<I, O> Node<Vec<I>> for BalancedSelector<I, O>
Auto Trait Implementations§
impl<I, O> Freeze for BalancedSelector<I, O>
impl<I, O> !RefUnwindSafe for BalancedSelector<I, O>
impl<I, O> Send for BalancedSelector<I, O>
impl<I, O> !Sync for BalancedSelector<I, O>
impl<I, O> Unpin for BalancedSelector<I, O>
impl<I, O> !UnwindSafe for BalancedSelector<I, O>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Input, Output, E> ExtendNode<Input, Output, E> for Ewhere
E: Node<Input, Output = Output>,
impl<Input, Output, E> ExtendNode<Input, Output, E> for Ewhere
E: Node<Input, Output = Output>,
Source§impl<Input, Output, E> ExtendNodeMap<Input, Output, E> for E
impl<Input, Output, E> ExtendNodeMap<Input, Output, E> for E
Source§impl<Input, Output, E> ExtendNodeSplit<Input, Output, E> for E
impl<Input, Output, E> ExtendNodeSplit<Input, Output, E> for E
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more