Struct NavItem
pub struct NavItem {Show 24 fields
pub id: String,
pub label: String,
pub icon: Option<Icon>,
pub count: Option<NavCount>,
pub actions: bool,
pub children: Vec<NavItem>,
pub expanded: bool,
pub ensure_expanded: bool,
pub drop_target: bool,
pub editable_label: bool,
pub secondary: Option<String>,
pub meta: Option<String>,
pub status: Option<NavItemStatus>,
pub status_label: Option<(String, Tone)>,
pub badge: Option<String>,
pub swatch: Option<AlphaColor<Srgb>>,
pub art: Option<NavArt>,
pub checked: Option<bool>,
pub level: Option<f32>,
pub presence: Vec<String>,
pub person: Option<NavPerson>,
pub unread: bool,
pub semantic_key: Option<String>,
pub search_terms: Vec<NavSearchTerm>,
}Expand description
One destination. Every part but the label is optional.
Fields§
§id: StringStable across rebuilds; selection, expansion and focus follow it.
label: String§icon: Option<Icon>§count: Option<NavCount>§actions: boolShow the list’s item actions (NavList::item_actions) on this row
on hover and focus.
children: Vec<NavItem>Nested destinations, indented one step.
expanded: boolStarts expanded (only meaningful with children).
ensure_expanded: boolOpens even where the person folded it (the place the app just revealed).
drop_target: boolOther items may be dragged into this one (NavList::on_move).
editable_label: boolThe label can be renamed in place (NavList::on_rename_action).
secondary: Option<String>§meta: Option<String>§status: Option<NavItemStatus>§status_label: Option<(String, Tone)>§badge: Option<String>§swatch: Option<AlphaColor<Srgb>>§art: Option<NavArt>A picture in the icon’s place (an album’s cover).
checked: Option<bool>§level: Option<f32>§presence: Vec<String>§person: Option<NavPerson>The person the row stands for, as their avatar in the icon’s place.
unread: boolSomething new waits behind the row (an unread conversation).
semantic_key: Option<String>The key assistive technology and tests address the row by; the
default is nav:item:{id}.
search_terms: Vec<NavSearchTerm>What else the row is found by when the list is filtered: the things the destination holds (“Tap to click” on a touchpad page) and the words people use for them. A row found by a term that has a name shows that name under its label.
Implementations§
pub fn new(id: impl Into<String>, label: impl Into<String>) -> NavItem
pub fn search_terms(
self,
terms: impl IntoIterator<Item = NavSearchTerm>,
) -> NavItem
pub fn search_terms( self, terms: impl IntoIterator<Item = NavSearchTerm>, ) -> NavItem
Also found, when the list is filtered, by terms: what the
destination holds and the words people use for it.
pub fn icon(self, icon: Icon) -> NavItem
pub fn count(self, count: u32) -> NavItem
pub fn count(self, count: u32) -> NavItem
A quiet count (items in a folder). Zero shows nothing: a count means something wants attention, and nothing does.
pub fn live_count(self, count: u32) -> NavItem
pub fn live_count(self, count: u32) -> NavItem
A count that wants attention (unread, mentions): the list’s one filled badge, in the person’s colour. Zero shows nothing.
pub fn children(self, children: Vec<NavItem>) -> NavItem
pub fn expanded(self) -> NavItem
pub fn ensure_expanded(self) -> NavItem
pub fn ensure_expanded(self) -> NavItem
Open this item whenever the sections are handed over, even where the person folded it: the place the app is revealing (the database a connection just opened).
pub fn drop_target(self) -> NavItem
pub fn editable_label(self) -> NavItem
pub fn without_actions(self) -> NavItem
pub fn without_actions(self) -> NavItem
This row offers none of the list’s item actions.
pub fn secondary(self, text: impl Into<String>) -> NavItem
pub fn secondary(self, text: impl Into<String>) -> NavItem
One Caption line under the label (a host and port, a schedule).
It elides; the row grows to hold it.
pub fn meta(self, text: impl Into<String>) -> NavItem
pub fn meta(self, text: impl Into<String>) -> NavItem
A tertiary figure at the trailing edge (a size).
pub fn status(self, status: RowStatus<'_>) -> NavItem
pub fn status(self, status: RowStatus<'_>) -> NavItem
A status dot at the trailing edge: a drive’s health, a connection’s state, an account that needs attention, a person’s presence.
pub fn status_label(self, label: impl Into<String>, tone: Tone) -> NavItem
pub fn status_label(self, label: impl Into<String>, tone: Tone) -> NavItem
A quiet tinted badge naming the row’s state (“Active”).
pub fn badge(self, code: impl Into<String>) -> NavItem
pub fn badge(self, code: impl Into<String>) -> NavItem
A short leading code that classifies the row (GET, POST). The
codes of one section share a column, so their labels line up.
pub fn swatch(self, color: AlphaColor<Srgb>) -> NavItem
pub fn swatch(self, color: AlphaColor<Srgb>) -> NavItem
The content colour the row stands for (a calendar, a project), in the icon’s place.
pub fn art(self, name: impl Into<String>, image: Option<ImageData>) -> NavItem
pub fn art(self, name: impl Into<String>, image: Option<ImageData>) -> NavItem
A small rounded picture in the icon’s place: what the destination
holds (an album’s cover), or the initials of name while it has
none. The label lines up with the icons of the rows around it.
pub fn checked(self, checked: bool) -> NavItem
pub fn checked(self, checked: bool) -> NavItem
A checkbox in the leading slot (a calendar shown or hidden). The
whole row toggles it and reports through NavList::on_check_action; a
checkable row is not a destination and is never selected.
pub fn level(self, fraction: f32) -> NavItem
pub fn level(self, fraction: f32) -> NavItem
A usage bar under the label, fraction of it filled (a backup
destination’s space).
pub fn presence(self, identity: impl Into<String>) -> NavItem
pub fn presence(self, identity: impl Into<String>) -> NavItem
Someone is on this place: a mark in their presence colour. Call once per person.
pub fn person(
self,
identity: impl Into<String>,
colour: Option<AlphaColor<Srgb>>,
speaking: bool,
) -> NavItem
pub fn person( self, identity: impl Into<String>, colour: Option<AlphaColor<Srgb>>, speaking: bool, ) -> NavItem
The row stands for a person (someone in a call): their avatar, in
colour, in the icon’s place, ringed while speaking. With no
colour, the avatar takes the colour their identity carries, as every
face of them does.
pub fn person_face(
self,
name: impl Into<String>,
image: Option<ImageData>,
) -> NavItem
pub fn person_face( self, name: impl Into<String>, image: Option<ImageData>, ) -> NavItem
The face of the person the row stands for (Self::person): the
name their initials come from and their picture.
pub fn unread(self, unread: bool) -> NavItem
pub fn unread(self, unread: bool) -> NavItem
Something new waits behind the row: its label stands out at rest.
pub fn semantic_key(self, key: impl Into<String>) -> NavItem
pub fn semantic_key(self, key: impl Into<String>) -> NavItem
The key assistive technology, agents and tests address the row by.
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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