[][src]Struct revent::Signal

pub struct Signal<T: ?Sized>(_);

Signal of interest, contains subscribers.

Signals are channels on which we can emit events synchronously. This is done by Signal::emit. Signals are not be created by the user directly, but are rather created via the hub and node macros.

Methods

impl<T: ?Sized> Signal<T>[src]

pub fn emit<F>(&mut self, caller: F) where
    F: FnMut(&mut T), 
[src]

Access all subscribers and apply a closure to each.

Subscribers are iterated in subscription order.

pub fn remove<F>(&mut self, predicate: F) where
    F: FnMut(&mut T) -> bool
[src]

Remove subscribers from a topic given a predicate. True removes the item.

Removing items does not perturb relative ordering.

pub fn sort_by<F>(&mut self, compare: F) where
    F: FnMut(&T, &T) -> Ordering
[src]

Sorts the topic with a comparator function.

Auto Trait Implementations

impl<T> !RefUnwindSafe for Signal<T>

impl<T> !Send for Signal<T>

impl<T> !Sync for Signal<T>

impl<T: ?Sized> 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.