[][src]Struct revent::Topic

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

A topic to which objects can subscribe.

Methods

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

pub fn new() -> Self[src]

Create a new topic object.

pub fn insert(&mut self, item: Rc<RefCell<T>>)[src]

Insert a new subscriber into this topic.

Appends the subscriber to the end of the subscriber list.

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

Modify all subscribers using the given closure.

Iterates over all subscribers in subscription order.

pub fn remove<'a, F>(
    &'a mut self,
    caller: F
) -> impl Iterator<Item = Rc<RefCell<T>>> + 'a where
    F: FnMut(&mut T) -> bool + 'a, 
[src]

Remove subscribers from this topic.

Preserves the relative order of subscribers. Returns an iterator over all removed items.

Trait Implementations

impl<T: ?Sized> Default for Topic<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Topic<T>

impl<T> !Send for Topic<T>

impl<T> !Sync for Topic<T>

impl<T: ?Sized> Unpin for Topic<T>

impl<T> !UnwindSafe for Topic<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.