pub struct ChangeNotifier { /* private fields */ }Expand description
A notifier with nothing to say but changed.
Cloning gives another handle to the same notifier.
Implementations§
Source§impl ChangeNotifier
impl ChangeNotifier
Sourcepub fn notify_listeners(&self)
pub fn notify_listeners(&self)
Tells every listener, in the order they were added, and asks for a rebuild.
A listener that adds or drops another during the notification does not disturb it: the ones told are those there when it began.
Sourcepub fn listener_count(&self) -> usize
pub fn listener_count(&self) -> usize
How many listeners there are.
Trait Implementations§
Source§impl Clone for ChangeNotifier
impl Clone for ChangeNotifier
Source§impl Debug for ChangeNotifier
impl Debug for ChangeNotifier
Source§impl Default for ChangeNotifier
impl Default for ChangeNotifier
Source§impl Listenable for ChangeNotifier
impl Listenable for ChangeNotifier
Source§fn add_listener(&self, listener: impl Fn() + 'static) -> Subscription
fn add_listener(&self, listener: impl Fn() + 'static) -> Subscription
Calls
listener whenever this changes, until the returned Subscription is
dropped.Auto Trait Implementations§
impl !RefUnwindSafe for ChangeNotifier
impl !Send for ChangeNotifier
impl !Sync for ChangeNotifier
impl !UnwindSafe for ChangeNotifier
impl Freeze for ChangeNotifier
impl Unpin for ChangeNotifier
impl UnsafeUnpin for ChangeNotifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more