pub trait WidgetObserver<T, W> {
// Required methods
fn set_action<Listen: Clone + 'static + Fn(&mut T, &Self)>(
&mut self,
l: Listen,
);
fn set_view<Update: Clone + 'static + Fn(&T, &mut Self)>(
&mut self,
u: Update,
);
}
Expand description
A trait to bind actions and views to widgets in response to shared state.
Required Methods§
Sourcefn set_action<Listen: Clone + 'static + Fn(&mut T, &Self)>(&mut self, l: Listen)
fn set_action<Listen: Clone + 'static + Fn(&mut T, &Self)>(&mut self, l: Listen)
Sets the action to be executed when the widget is interacted with. The function receives mutable access to the shared state and a reference to the widget.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.