pub trait Interface: Facet {
// Provided methods
fn options(&self) -> Vec<Key> ⓘ { ... }
fn select(&mut self, _key: &str) -> bool { ... }
fn selected(&mut self) -> Option<&mut dyn Interface> { ... }
fn controls(&self) -> Vec<Control> { ... }
}Expand description
A node in the app’s ui tree — recursive, so a tab and a view mode are the same kind of thing at different depths.
app.ui().select("map");
app.ui().selected()?.select("3d"); // the SAME call, one level downThe controls under a choice are not looked up: they are selected.
Pick 3d and you get the 3d node; its Facet::ui draws 3d’s controls, and nothing else
can appear because nothing else was returned.
A leaf overrides nothing — impl Interface for MyPane {} is complete and means “no
sub-choices”. See the module docs for why there is no blanket impl.
Provided Methods§
Sourcefn options(&self) -> Vec<Key> ⓘ
fn options(&self) -> Vec<Key> ⓘ
The choices available AT THIS LEVEL, in display order — tabs at the top, view modes one level down.
This must be the only list. korp’s tab strip, its state oracle and its own test each carried a separate copy — 17, 16 and 9 entries — and the test compared its copy to itself, so it was green forever while the first tab was unreachable. One list cannot disagree with itself.
Sourcefn select(&mut self, _key: &str) -> bool
fn select(&mut self, _key: &str) -> bool
Choose one of options. Returns false for a key that is not on
offer — a caller that ignores the result is asking for the same silent-no-op class
this module exists to kill.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".