pub struct MetroView { /* private fields */ }Expand description
A subway-map view of test-coverage chains — a [Facet]. Renders each
MetroLine as a horizontal coloured line with circular stops; green tint
when the line is fully lit, red unlit stops when not.
Implementations§
Source§impl MetroView
impl MetroView
Sourcepub fn set_title(&mut self, title: impl Into<String>)
pub fn set_title(&mut self, title: impl Into<String>)
Re-title the view (the deck keys facets off [Facet::title], so a host that
mounts the local()/remote() view under a specific tab key sets it here).
Sourcepub fn state(&self) -> &MetroState
pub fn state(&self) -> &MetroState
FC-3 — read the complete observable state at any frame boundary.
Sourcepub fn select(&mut self, id: Option<String>)
pub fn select(&mut self, id: Option<String>)
Select a line by id (None clears). A thin wrapper over the FC-2
update mutation path.
Sourcepub fn local() -> Self
pub fn local() -> Self
Discovery-contract local() — the canonical no-arg ctor the test
matrix calls to enumerate this facet. Builds a synthetic 2-line demo map
(one fully-lit/green chain, one with an unlit emitter/red) so the view
renders real lines with no fixture on disk. Mirrors the rest of the
facett discovery law (OsmView::local() etc.).
Source§impl MetroView
impl MetroView
Sourcepub fn view(&self, ui: &mut Ui) -> Vec<Msg>
pub fn view(&self, ui: &mut Ui) -> Vec<Msg>
FC-9 render — a pure function of &self: it paints the header + the
subway lines and returns the Msgs the interactions produced (none today —
the trunk is Sense::hover, selection is host-driven via select).
It MUST NOT mutate the MetroState; the
impl_facet_via_elm! bridge applies any
returned messages through update.
Trait Implementations§
Source§impl CopySource for MetroView
impl CopySource for MetroView
Source§fn copy_kinds(&self) -> &[ClipKind]
fn copy_kinds(&self) -> &[ClipKind]
Source§fn copy_payload(&self) -> Option<ClipPayload>
fn copy_payload(&self) -> Option<ClipPayload>
Source§impl Elm for MetroView
impl Elm for MetroView
Source§type Model = MetroState
type Model = MetroState
Source§type Msg = Msg
type Msg = Msg
Model.Source§type Effect = Effect
type Effect = Effect
enum Effect {} when the component does no I/O.Source§fn title(&self) -> &str
fn title(&self) -> &str
Facet::title).Source§fn state(&self) -> &MetroState
fn state(&self) -> &MetroState
Source§impl Facet for MetroView
impl Facet for MetroView
Source§fn ui(&mut self, ui: &mut Ui)
fn ui(&mut self, ui: &mut Ui)
FC-9: the view is pure (paints + emits Msgs); FC-2: mutation only
via update. The immediate-mode trait just bridges the two.
Source§fn caps(&self) -> FacetCaps
fn caps(&self) -> FacetCaps
Reads the active Theme (stops/line colours follow the palette) and
refits to any host size; a line is selectable for drill-in.
fn title(&self) -> &str
fn state_json(&self) -> Value
Source§fn copy(&mut self) -> Option<String>
fn copy(&mut self) -> Option<String>
Source§fn selection_json(&self) -> Value
fn selection_json(&self) -> Value
state_json by
convention). Null when nothing/none selectable.Source§fn as_any_mut(&mut self) -> Option<&mut dyn Any>
fn as_any_mut(&mut self) -> Option<&mut dyn Any>
FacetDeck (e.g. a robot-UI driver clicking an
app-level control that must forward to a concrete component’s own API).
Defaulted to None so no existing facet has to change; a component opts in
by returning Some(self).Source§fn set_scale(&mut self, _scale: f32)
fn set_scale(&mut self, _scale: f32)
Source§fn cut(&mut self) -> Option<String>
fn cut(&mut self) -> Option<String>
copy, but also removes the selection. Default delegates to copy.Source§fn kind(&self) -> &'static str
fn kind(&self) -> &'static str
"jobview", "graphpan", "table"). Two
instances with the same kind can exchange portable state; the empty
default "" means opted out of cross-instance clone.Source§fn portable_state(&self) -> Option<Value>
fn portable_state(&self) -> Option<Value>
None = not cloneable. Kept SEPARATE from
state_json (the introspection dump, which may carry
derived / render-only data) so this stays round-trippable through
load_state.Source§fn load_state(&mut self, _state: &Value) -> bool
fn load_state(&mut self, _state: &Value) -> bool
portable_state
on a same-kind sibling. Returns true if accepted. Default false
(opt-in per component).