pub struct SidebarItem {
pub id: String,
pub label: String,
pub icon: Option<char>,
pub disabled: bool,
pub badge: Option<String>,
pub children: Vec<SidebarItem>,
pub expanded: bool,
}Expand description
Sidebar item representing a navigation entry
Fields§
§id: StringUnique identifier for this item
label: StringDisplay label
icon: Option<char>Icon character (emoji or unicode symbol)
disabled: boolWhether item is disabled
badge: Option<String>Badge text (e.g., notification count)
children: Vec<SidebarItem>Child items for nested navigation
expanded: boolWhether children are expanded
Implementations§
Source§impl SidebarItem
impl SidebarItem
Sourcepub fn children(self, children: Vec<SidebarItem>) -> Self
pub fn children(self, children: Vec<SidebarItem>) -> Self
Add child items
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Check if item has children
Trait Implementations§
Source§impl Clone for SidebarItem
impl Clone for SidebarItem
Source§fn clone(&self) -> SidebarItem
fn clone(&self) -> SidebarItem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SidebarItem
impl RefUnwindSafe for SidebarItem
impl Send for SidebarItem
impl Sync for SidebarItem
impl Unpin for SidebarItem
impl UnsafeUnpin for SidebarItem
impl UnwindSafe for SidebarItem
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
Mutably borrows from an owned value. Read more