pub struct NotifyWatcher<TValueFn, TValue>where
TValueFn: Fn() -> TValue,{ /* private fields */ }Expand description
Watcher that calls a ‘notify’ method whenever its core value changes
Implementations§
Source§impl<TValueFn, TValue> NotifyWatcher<TValueFn, TValue>where
TValueFn: Fn() -> TValue,
impl<TValueFn, TValue> NotifyWatcher<TValueFn, TValue>where
TValueFn: Fn() -> TValue,
Sourcepub fn new(
get_value: TValueFn,
to_notify: Arc<dyn Notifiable>,
) -> (NotifyWatcher<TValueFn, TValue>, ReleasableNotifiable)
pub fn new( get_value: TValueFn, to_notify: Arc<dyn Notifiable>, ) -> (NotifyWatcher<TValueFn, TValue>, ReleasableNotifiable)
Creates a new notify watcher
The return value is the watcher and the function to call to indicate that a change has happened in the
underlying data store (the corresponding to_notify notification will be fired only if get() has been
called since the last update)
Trait Implementations§
Source§impl<TValueFn, TValue> Drop for NotifyWatcher<TValueFn, TValue>where
TValueFn: Fn() -> TValue,
impl<TValueFn, TValue> Drop for NotifyWatcher<TValueFn, TValue>where
TValueFn: Fn() -> TValue,
Source§impl<TValueFn, TValue> Watcher<TValue> for NotifyWatcher<TValueFn, TValue>where
TValueFn: Fn() -> TValue,
impl<TValueFn, TValue> Watcher<TValue> for NotifyWatcher<TValueFn, TValue>where
TValueFn: Fn() -> TValue,
Auto Trait Implementations§
impl<TValueFn, TValue> Freeze for NotifyWatcher<TValueFn, TValue>where
TValueFn: Freeze,
impl<TValueFn, TValue> RefUnwindSafe for NotifyWatcher<TValueFn, TValue>where
TValueFn: RefUnwindSafe,
impl<TValueFn, TValue> Send for NotifyWatcher<TValueFn, TValue>where
TValueFn: Send,
impl<TValueFn, TValue> Sync for NotifyWatcher<TValueFn, TValue>where
TValueFn: Sync,
impl<TValueFn, TValue> Unpin for NotifyWatcher<TValueFn, TValue>where
TValueFn: Unpin,
impl<TValueFn, TValue> UnwindSafe for NotifyWatcher<TValueFn, TValue>where
TValueFn: UnwindSafe,
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