[][src]Struct rt_graph::Signal

pub struct Signal<T: Clone> { /* fields omitted */ }

Implements a broadcast-listener / callback / observable pattern.

Signal holds a list of subscriptions, each with a callback closure to run on the next broadcast.

As rt-graph uses GTK, the terminology (Signal struct and its method names) match GTK's terms.

Implementations

impl<T: Clone> Signal<T>[src]

pub fn new() -> Signal<T>[src]

Construct a new Signal.

pub fn connect<F>(&mut self, callback: F) -> SubscriptionId where
    F: Fn(T) + 'static, 
[src]

Connect a new subscriber that will receive callbacks when the signal is raised.

Returns a SubscriptionId to disconnect the subscription when no longer required.

pub fn raise(&self, value: T)[src]

Notify existing subscribers.

pub fn disconnect(&mut self, id: SubscriptionId)[src]

Disconnect an existing subscription.

Auto Trait Implementations

impl<T> !RefUnwindSafe for Signal<T>

impl<T> !Send for Signal<T>

impl<T> !Sync for Signal<T>

impl<T> Unpin for Signal<T>

impl<T> !UnwindSafe for Signal<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,