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 filterable: 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.
filterable: boolThe window’s filter narrows this section’s items.
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 filterable(self) -> NavSection
pub fn filterable(self) -> NavSection
Let the window’s filter field (super::NavShell::with_filter)
narrow this section’s items. Sections that do not opt in (a list of
connections above the tables being filtered) stay as they are.
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> 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