pub trait ViewController {
// Required method
fn id(&self) -> &str;
// Provided methods
fn scope(&self) -> TargetScope { ... }
fn actions(&self) -> Vec<Action> { ... }
fn activated(&mut self, _frame: &Frame) { ... }
fn deactivated(&mut self, _frame: &Frame) { ... }
fn view_controls_created(&mut self, _frame: &Frame) { ... }
}Expand description
Behavior tied to a view: it turns on when a view it targets is shown, and off when that goes. Its actions are off while it is off. Each frame has its own.
Required Methods§
Provided Methods§
Sourcefn scope(&self) -> TargetScope
fn scope(&self) -> TargetScope
Which views it is for. Every one by default.
Sourcefn deactivated(&mut self, _frame: &Frame)
fn deactivated(&mut self, _frame: &Frame)
The view is going, or something turned it off.
Sourcefn view_controls_created(&mut self, _frame: &Frame)
fn view_controls_created(&mut self, _frame: &Frame)
The view’s controls exist now.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".