Struct NavSection
pub struct NavSection {
pub id: String,
pub title: String,
pub collapsible: bool,
pub collapsed: bool,
pub trailing_action: Option<NavAction>,
pub empty_caption: Option<String>,
pub pending: u8,
pub filterable: bool,
pub editable_title: bool,
pub menu: bool,
pub items: Vec<NavItem>,
}Expand description
A group of destinations under a sentence-case title.
Fields§
§id: String§title: StringSentence case (“Mailboxes”, “On this device”). An empty title draws no header: the items stand at the top level.
collapsible: boolThe person can fold the section away.
collapsed: boolThe section starts folded.
trailing_action: Option<NavAction>A trailing action on the header (usually “New …” with
Icon::Plus); reported through NavList::on_section_action.
empty_caption: Option<String>The one quiet line the section shows while it has no items.
pending: u8Rows standing in, while it has no items, for items still being read.
filterable: boolThe window’s filter narrows this section’s items.
editable_title: boolThe title can be renamed in place (NavList::on_rename_action).
The header has a menu (NavList::on_context_menu).
items: Vec<NavItem>Implementations§
pub fn new( id: impl Into<String>, title: impl Into<String>, items: Vec<NavItem>, ) -> NavSection
pub fn untitled(id: impl Into<String>, items: Vec<NavItem>) -> NavSection
pub fn untitled(id: impl Into<String>, items: Vec<NavItem>) -> NavSection
Items with no header above them.
pub fn collapsible(self) -> NavSection
pub fn collapsed(self) -> NavSection
pub fn collapsed(self) -> NavSection
Fold the section when it first appears (it stays foldable).
pub fn trailing_action(self, action: NavAction) -> NavSection
pub fn empty_caption(self, caption: impl Into<String>) -> NavSection
pub fn empty_caption(self, caption: impl Into<String>) -> NavSection
What the section says while it holds nothing (“No drafts”): one sentence, in tertiary ink, where its first row would be.
pub fn pending(self, rows: u8) -> NavSection
pub fn pending(self, rows: u8) -> NavSection
While the section has no items because they are still being read,
rows rows stand in for them: the shape of a row (its icon and its
label), in the skeleton tone, so nothing moves when the items arrive.
They are not destinations: nothing selects them, the arrow keys pass
over them, and assistive technology hears “Loading”.
pub fn filterable(self) -> NavSection
pub fn filterable(self) -> NavSection
Let the window’s search narrow this section’s items: the window
bar’s field, or a shell’s own super::NavShell::with_filter field.
The section draws no field itself. Sections that do not opt in (a
list of connections above the tables being filtered) stay as they
are.
pub fn editable_title(self) -> NavSection
pub fn editable_title(self) -> NavSection
The person can rename the section in place: F2 on its header, or
NavFeed::begin_rename from its menu.
The header asks for its menu as an item’s row does: a right click, a
long press, the Menu key (NavList::on_context_menu, with the
section’s id).
Trait Implementations§
§fn clone(&self) -> NavSection
fn clone(&self) -> NavSection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto 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