Skip to main content

ViewController

Trait ViewController 

Source
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§

Source

fn id(&self) -> &str

What it is known by.

Provided Methods§

Source

fn scope(&self) -> TargetScope

Which views it is for. Every one by default.

Source

fn actions(&self) -> Vec<Action>

The actions it brings. Asked once.

Source

fn activated(&mut self, _frame: &Frame)

A view it targets is in place.

Source

fn deactivated(&mut self, _frame: &Frame)

The view is going, or something turned it off.

Source

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".

Implementors§