pub struct Signal<I, O, F>where
F: SigFn<I, O>,{ /* private fields */ }
Expand description
Signals are the bread and butter of the crate. A signal can trigger other signals whose input is the same output as the original signal. Signals support both threaded and non-threaded children.
Implementations§
source§impl<I, O, F> Signal<I, O, F>where
F: 'static + SigFn<I, O> + Send + Sync,
O: 'static + Send + Sync + Clone,
I: 'static + Send + Sync,
impl<I, O, F> Signal<I, O, F>where
F: 'static + SigFn<I, O> + Send + Sync,
O: 'static + Send + Sync + Clone,
I: 'static + Send + Sync,
sourcepub fn new_arc_mutex(f: F) -> Am<Signal<I, O, impl SigFn<I, O>>>
pub fn new_arc_mutex(f: F) -> Am<Signal<I, O, impl SigFn<I, O>>>
Create a thread-safe parent signal. Note that the return function is Arc<Mutex<Signal<>>>
sourcepub fn create_listener<Q, G>(
&mut self,
f: G
) -> Am<Signal<O, Q, impl SigFn<O, Q>>>where
G: 'static + SigFn<O, Q> + Send + Sync,
Q: 'static + PartialEq + Send + Sync + Clone,
O: 'static,
pub fn create_listener<Q, G>(
&mut self,
f: G
) -> Am<Signal<O, Q, impl SigFn<O, Q>>>where
G: 'static + SigFn<O, Q> + Send + Sync,
Q: 'static + PartialEq + Send + Sync + Clone,
O: 'static,
This method is a helper for Signal::new(f) and register_listener(…)
sourcepub fn create_threaded_listener<Q, G>(
&mut self,
f: G
) -> Am<Signal<O, Q, impl SigFn<O, Q>>>where
G: 'static + SigFn<O, Q> + Send + Sync,
Q: 'static + PartialEq + Send + Sync + Clone,
O: 'static,
pub fn create_threaded_listener<Q, G>(
&mut self,
f: G
) -> Am<Signal<O, Q, impl SigFn<O, Q>>>where
G: 'static + SigFn<O, Q> + Send + Sync,
Q: 'static + PartialEq + Send + Sync + Clone,
O: 'static,
This method is a helper for Signal::new(f) and register_threaded_listener(…)
sourcepub fn register_listener<E>(&mut self, strong: &Am<E>)where
E: 'static + Emitter<input = O>,
pub fn register_listener<E>(&mut self, strong: &Am<E>)where
E: 'static + Emitter<input = O>,
Register a child listener that will execute in the same thread as Self.
sourcepub fn register_threaded_listener<E>(&mut self, strong: &Am<E>)where
E: 'static + Emitter<input = O>,
pub fn register_threaded_listener<E>(&mut self, strong: &Am<E>)where
E: 'static + Emitter<input = O>,
Register a child listener that will run on its own thread.