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>
impl<I, O, F> Signal<I, O, F>
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>>>
pub fn create_listener<Q, G>( &mut self, f: G, ) -> Am<Signal<O, Q, impl SigFn<O, Q>>>
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>>>
pub fn create_threaded_listener<Q, G>( &mut self, f: G, ) -> Am<Signal<O, Q, impl SigFn<O, Q>>>
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.
Trait Implementations§
Auto Trait Implementations§
impl<I, O, F> Freeze for Signal<I, O, F>
impl<I, O, F> RefUnwindSafe for Signal<I, O, F>
impl<I, O, F> Send for Signal<I, O, F>
impl<I, O, F> Sync for Signal<I, O, F>
impl<I, O, F> Unpin for Signal<I, O, F>
impl<I, O, F> UnwindSafe for Signal<I, O, F>
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