pub struct DevToolsDashboard {
pub panels: Vec<Panel>,
pub active_panel: usize,
pub visible: bool,
}Expand description
The DevTools dashboard managing panels and rendering widgets.
Fields§
§panels: Vec<Panel>The panels currently open in the dashboard.
active_panel: usizeIndex of the currently active (selected) panel.
visible: boolWhether the dashboard overlay is visible.
Implementations§
Source§impl DevToolsDashboard
impl DevToolsDashboard
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new DevToolsDashboard with default panels.
The dashboard starts hidden with a Performance Metrics panel and a Log View panel pre-configured.
§Examples
use cvkg_cli::devtools::DevToolsDashboard;
let dashboard = DevToolsDashboard::new();
assert!(!dashboard.visible);
assert_eq!(dashboard.panels.len(), 2);Sourcepub fn remove_panel(&mut self, index: usize)
pub fn remove_panel(&mut self, index: usize)
Remove the panel at the given index.
If the index is out of bounds, this is a no-op. After removal, the active panel index is clamped to the new length.
§Arguments
index— The zero-based index of the panel to remove.
Sourcepub fn set_active(&mut self, index: usize)
pub fn set_active(&mut self, index: usize)
Set the active (selected) panel by index.
If the index is out of bounds, this is a no-op.
§Arguments
index— The zero-based index of the panel to activate.
Sourcepub fn render(&self) -> Vec<DevToolWidget>
pub fn render(&self) -> Vec<DevToolWidget>
Render the dashboard into a list of DevToolWidget primitives.
Only the active panel is rendered. If the dashboard is not visible or has no panels, an empty Vec is returned.
Trait Implementations§
Source§impl Clone for DevToolsDashboard
impl Clone for DevToolsDashboard
Source§fn clone(&self) -> DevToolsDashboard
fn clone(&self) -> DevToolsDashboard
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more