pub trait Panel {
// Required methods
fn title(&self) -> &str;
fn ui(&mut self, ui: &mut Ui);
fn state_json(&self) -> Value;
fn update_json(&mut self, msg_json: &str);
}Expand description
One pane, host-/backend-agnostic. The single seam every UI pane implements.
It is object-safe (Box<dyn Panel> is the currency the deck/host holds),
and it mirrors Facet’s four core methods so the blanket impl
below makes every Facet a Panel.
Required Methods§
Sourcefn ui(&mut self, ui: &mut Ui)
fn ui(&mut self, ui: &mut Ui)
Paint into the live egui frame. Backends: native paints directly; the
native cross-host adapter forwards to the guest pane’s own ui; the wasm
backend paints a decoded display-list; headless paints nothing.
Sourcefn state_json(&self) -> Value
fn state_json(&self) -> Value
FC-3 observable state — the common currency for tests + the web state-hook.
Sourcefn update_json(&mut self, msg_json: &str)
fn update_json(&mut self, msg_json: &str)
The Elm mutation path — apply one message (JSON). Used by the headless drive + robotui, and by the wasm/adapter backends to route host-side input.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<T: Facet + ?Sized> Panel for T
Backend (1): native in-process. The blanket impl that makes every facett
Facet a Panel with zero per-facet code. It forwards each
of the four Panel methods to the identically-shaped Facet method (the
update_json default landed on Facet for exactly this convergence). There is
no boundary, no serialize, no wasm toolchain — this is what a pane runs in its
own app’s desktop client, the common case for every inventoried pane.