Struct signals::Signal [] [src]

pub struct Signal<I, O, F> where
    F: SigFn<I, O>, 
{ /* fields omitted */ }

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.

Methods

impl<I, O, F> Signal<I, O, F> where
    F: SigFn<I, O>,
    O: 'static + Send + Sync
[src]

[src]

Create a thread-safe parent signal. Note that the return function is Arc<Mutex<Signal<>>>

[src]

This method is a helper for Signal::new(f) and register_listener(...)

[src]

This method is a helper for Signal::new(f) and register_threaded_listener(...)

[src]

Register a child listener that will execute in the same thread as Self.

[src]

Register a child listener that will run on its own thread.

[src]

Get the last result of this signal. If signal has not run, then it will return the Signal's output's default value.

Trait Implementations

impl<I, O, F> Emitter for Signal<I, O, F> where
    F: SigFn<I, O> + Send,
    O: 'static + PartialEq + Send + Sync,
    I: Send
[src]

[src]

This emit is a helper function. It will copy the input into an Arc<>

[src]

This emit takes an Arc, and will emit the calculated value to children when the calculated value changes.

Auto Trait Implementations

impl<I, O, F> Send for Signal<I, O, F> where
    F: Send,
    I: Send,
    O: Send + Sync

impl<I, O, F> Sync for Signal<I, O, F> where
    F: Sync,
    I: Sync,
    O: Send + Sync