pub struct NavItem<K = String> { /* private fields */ }Expand description
One data-driven selector item, returned by item inside a Selector::items mapper.
Implementations§
Sourcepub fn icon(self, icon: impl Into<ImageName>) -> NavItem<K>
pub fn icon(self, icon: impl Into<ImageName>) -> NavItem<K>
A bundled-image name for the item’s native icon (same convention as
Selector::item_icon).
Sourcepub fn icon_tint(self, color: Color) -> NavItem<K>
pub fn icon_tint(self, color: Color) -> NavItem<K>
Tint this row’s icon (docs/vectors.md): the glyph recolors to color instead of the
backend’s neutral template tint. Backends without per-row tinting keep the neutral look.
Sourcepub fn badge<M>(self, badge: impl IntoText<M>) -> NavItem<K>
pub fn badge<M>(self, badge: impl IntoText<M>) -> NavItem<K>
A trailing accessory for this row — an unread count, a status. Rendered right-aligned and de-emphasized where the toolkit has an affordance for it, and dropped where it does not (see docs/coverage-matrix.md).
Sourcepub fn section<M>(self, title: impl IntoText<M>) -> NavItem<K>
pub fn section<M>(self, title: impl IntoText<M>) -> NavItem<K>
Open a new section with this header, immediately before this row.
Sourcepub fn immersive(self) -> NavItem<K>
pub fn immersive(self) -> NavItem<K>
Mark this item’s pushed page immersive-chrome (docs/navigation.md) — the data-driven
counterpart of Selector::immersive.
Auto Trait Implementations§
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more