Skip to main content

NavItem

Struct NavItem 

Source
pub struct NavItem<K = String> { /* private fields */ }
Expand description

One data-driven selector item, returned by item inside a Selector::items mapper.

Implementations§

Source§

impl<K> NavItem<K>

Source

pub fn icon(self, icon: impl Into<ImageName>) -> Self

A bundled-image name for the item’s native icon (same convention as Selector::item_icon).

Source

pub fn icon_tint(self, color: Color) -> Self

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.

Source

pub fn badge<M>(self, badge: impl IntoText<M>) -> Self

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).

Source

pub fn section<M>(self, title: impl IntoText<M>) -> Self

Open a new section with this header, immediately before this row.

Source

pub fn immersive(self) -> Self

Mark this item’s pushed page immersive-chrome (docs/navigation.md) — the data-driven counterpart of Selector::immersive.

Auto Trait Implementations§

§

impl<K> Freeze for NavItem<K>
where K: Freeze,

§

impl<K = String> !RefUnwindSafe for NavItem<K>

§

impl<K = String> !Send for NavItem<K>

§

impl<K = String> !Sync for NavItem<K>

§

impl<K> Unpin for NavItem<K>
where K: Unpin,

§

impl<K> UnsafeUnpin for NavItem<K>
where K: UnsafeUnpin,

§

impl<K = String> !UnwindSafe for NavItem<K>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> ErasedDestructor for T
where T: 'static,

Day API ↩ Guides· daybrite.dev