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 moreSource§impl Debug for DevToolsDashboard
impl Debug for DevToolsDashboard
Auto Trait Implementations§
impl Freeze for DevToolsDashboard
impl RefUnwindSafe for DevToolsDashboard
impl Send for DevToolsDashboard
impl Sync for DevToolsDashboard
impl Unpin for DevToolsDashboard
impl UnsafeUnpin for DevToolsDashboard
impl UnwindSafe for DevToolsDashboard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.