[−][src]Struct rt_graph::Signal
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]
F: Fn(T) + 'static,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,