pub struct SidebarItem<T: 'static> { /* private fields */ }Expand description
An item of a Sidebar: a title, the value choosing it gives the
sidebar’s selection, and optionally an icon.
In view!, its text is its title:
<SidebarItem value=Page::General icon="gearshape">"General"</SidebarItem>.
Implementations§
Source§impl<T: 'static> SidebarItem<T>
impl<T: 'static> SidebarItem<T>
pub fn new(title: impl IntoValue<String>, value: T) -> SidebarItem<T>
Sourcepub fn value<U: 'static>(self, value: U) -> SidebarItem<U>
pub fn value<U: 'static>(self, value: U) -> SidebarItem<U>
The value choosing it gives the sidebar’s selection.
Sourcepub fn icon(self, name: impl Into<String>) -> SidebarItem<T>
pub fn icon(self, name: impl Into<String>) -> SidebarItem<T>
The name of its icon in the platform’s own set, picked with
platform!: an SF Symbol on macOS ("gearshape"), a symbolic icon
of the theme on GTK and KDE ("preferences-system-symbolic"), a
Segoe Fluent Icons glyph on Windows ("\u{E713}"). Empty: none.
A platform that can’t find it shows none.
Trait Implementations§
Source§impl<T: 'static> SidebarEntries<T> for SidebarItem<T>
impl<T: 'static> SidebarEntries<T> for SidebarItem<T>
fn add_to(self, sections: &mut Vec<SidebarSection<T>>)
Source§impl<T: 'static> SidebarItems<T> for SidebarItem<T>
impl<T: 'static> SidebarItems<T> for SidebarItem<T>
fn add_to(self, items: &mut Vec<SidebarItem<T>>)
Auto Trait Implementations§
impl<T> !RefUnwindSafe for SidebarItem<T>
impl<T> !Send for SidebarItem<T>
impl<T> !Sync for SidebarItem<T>
impl<T> !UnwindSafe for SidebarItem<T>
impl<T> Freeze for SidebarItem<T>where
T: Freeze,
impl<T> Unpin for SidebarItem<T>where
T: Unpin,
impl<T> UnsafeUnpin for SidebarItem<T>where
T: UnsafeUnpin,
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