pub trait WatcherInit<'ctx, T: ?Sized, O: ?Sized = DefaultOwner> {
    // Required methods
    fn init_child<F, Ch>(&mut self, func: F)
       where F: 'static + Clone + Fn(&mut T) -> &mut Ch,
             Ch: Watcher<'ctx, O>;
    fn watch<F>(&mut self, func: F)
       where Self: WatcherInit<'static, T, DefaultOwner>,
             F: 'static + Fn(&mut T);
    fn watch_for_new_child<F, W>(&mut self, func: F)
       where Self: WatcherInit<'static, T, DefaultOwner>,
             F: 'static + Fn(&mut T) -> Option<W>,
             W: 'static + WatcherHolder<'static, DefaultOwner>,
             W::Content: Watcher<'static, DefaultOwner>;
    fn watch_explicit<F>(&mut self, func: F)
       where F: 'static + Fn(WatchArg<'_, 'ctx, O>, &mut T);
    fn watch_for_new_child_explicit<F, W>(&mut self, func: F)
       where F: 'static + Fn(WatchArg<'_, 'ctx, O>, &mut T) -> Option<W>,
             W: 'ctx + WatcherHolder<'ctx, O>,
             W::Content: Watcher<'ctx, O>;
}

Required Methods§

source

fn init_child<F, Ch>(&mut self, func: F)
where F: 'static + Clone + Fn(&mut T) -> &mut Ch, Ch: Watcher<'ctx, O>,

source

fn watch<F>(&mut self, func: F)
where Self: WatcherInit<'static, T, DefaultOwner>, F: 'static + Fn(&mut T),

Use this to set up a function which should be re-run whenever watched values referenced inside change.

source

fn watch_for_new_child<F, W>(&mut self, func: F)
where Self: WatcherInit<'static, T, DefaultOwner>, F: 'static + Fn(&mut T) -> Option<W>, W: 'static + WatcherHolder<'static, DefaultOwner>, W::Content: Watcher<'static, DefaultOwner>,

source

fn watch_explicit<F>(&mut self, func: F)
where F: 'static + Fn(WatchArg<'_, 'ctx, O>, &mut T),

Use this to set up a function which should be re-run whenever watched values referenced inside change.

source

fn watch_for_new_child_explicit<F, W>(&mut self, func: F)
where F: 'static + Fn(WatchArg<'_, 'ctx, O>, &mut T) -> Option<W>, W: 'ctx + WatcherHolder<'ctx, O>, W::Content: Watcher<'ctx, O>,

Object Safety§

This trait is not object safe.

Implementors§