[−][src]Struct revent::Topic
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]
F: FnMut(&mut T),
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]
&'a mut self,
caller: F
) -> impl Iterator<Item = Rc<RefCell<T>>> + 'a where
F: FnMut(&mut T) -> bool + 'a,
Remove subscribers from this topic.
Preserves the relative order of subscribers. Returns an iterator over all removed items.
Trait Implementations
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]
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,
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.
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>,