Struct cfrp::primitives::fork::Branch
[−]
[src]
pub struct Branch<A> where
A: 'static + Send, { /* fields omitted */ }
A data source of type A
which can be used as input more than once
This operation is equivalent to a "let" binding, or variable assignment.
Branch implements Clone
, and each clone runs in its own thread.
Branches are returned when add
is called on a Builder
Methods
impl<A> Branch<A> where
A: 'static + Send,
[src]
A: 'static + Send,
fn new(
config: Config,
fork_txs: Arc<Mutex<Vec<SyncSender<Event<A>>>>>,
source_rx: Option<Receiver<Event<A>>>,
initial: SignalType<A>
) -> Branch<A>
config: Config,
fork_txs: Arc<Mutex<Vec<SyncSender<Event<A>>>>>,
source_rx: Option<Receiver<Event<A>>>,
initial: SignalType<A>
) -> Branch<A>
Trait Implementations
impl<A> Signal<A> for Branch<A> where
A: 'static + Send + Clone,
[src]
A: 'static + Send + Clone,
fn config(&self) -> Config
fn initial(&self) -> SignalType<A>
fn push_to(self: Box<Self>, target: Option<Box<Push<A>>>)
fn init(&mut self)
impl<A> SignalExt<A> for Branch<A> where
A: 'static + Send + Clone,
[src]
A: 'static + Send + Clone,
fn lift<F, B>(self, f: F) -> LiftSignal<F, A, B> where
F: 'static + Send + Fn(A) -> B,
B: 'static + Send + Clone,
F: 'static + Send + Fn(A) -> B,
B: 'static + Send + Clone,
Transform in input signal into an output signal Read more
fn lift2<F, SB, B, C>(self, right: SB, f: F) -> Lift2Signal<F, A, B, C> where
SB: 'static + Signal<B>,
F: 'static + Send + Fn(Value<A>, Value<B>) -> C,
B: 'static + Send + Clone,
C: 'static + Send + Clone,
SB: 'static + Signal<B>,
F: 'static + Send + Fn(Value<A>, Value<B>) -> C,
B: 'static + Send + Clone,
C: 'static + Send + Clone,
Combine two signals into an output signal Read more
fn fold<F, B>(self, initial: B, f: F) -> FoldSignal<F, A, B> where
F: 'static + Send + Fn(B, A) -> B,
B: 'static + Send + Clone,
F: 'static + Send + Fn(B, A) -> B,
B: 'static + Send + Clone,
Merge data from a signal into an accumulator and return a signal with the accumulator's value Read more
fn add_to(self, builder: &Builder) -> Branch<A>
Sugar for Builder::add
Read more
fn async(self, builder: &Builder) -> Branch<A>
Sugar for Builder::async
Read more
fn map<F, B>(self, f: F) -> LiftSignal<F, A, B> where
F: 'static + Send + Fn(A) -> B,
B: 'static + Send + Clone,
F: 'static + Send + Fn(A) -> B,
B: 'static + Send + Clone,
Alias of lift
fn zip<SB, B>(self, right: SB) -> Box<Signal<(Value<A>, Value<B>)>> where
SB: 'static + Signal<B>,
B: 'static + Send + Clone,
SB: 'static + Signal<B>,
B: 'static + Send + Clone,
Takes two input signals and returns a signal containing 2-tuples of elements from the input signals. Read more
fn enumerate(self) -> Box<Signal<(usize, A)>>
Same as Iterator::enumerate
. Read more
fn filter<F>(self, f: F) -> Box<Signal<Option<A>>> where
F: 'static + Send + Fn(&A) -> bool,
F: 'static + Send + Fn(&A) -> bool,
Filter an input stream by a predicate function F
. Read more
fn inspect<F>(self, f: F) -> Box<Signal<A>> where
F: 'static + Send + Fn(&A) -> bool,
F: 'static + Send + Fn(&A) -> bool,
Pass each value in a signal to F
before sending it to an output signal. Read more
impl<A> Clone for Branch<A> where
A: 'static + Send + Clone,
[src]
A: 'static + Send + Clone,
fn clone(&self) -> Branch<A>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more