#[non_exhaustive]pub struct PlaceSection {
pub id: String,
pub title: String,
pub items: Vec<PlaceItem>,
pub fold: Option<bool>,
pub open: Option<bool>,
pub empty: Option<String>,
pub keep: bool,
pub untitled: bool,
}Expand description
A titled list of places: the system’s folders, the devices, or an
application’s (“Cards”, “Services”); or an untitled one, its rows shown
without a heading (PlaceSection::untitled).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringIts id: unique among the sections shown.
title: String§items: Vec<PlaceItem>§fold: Option<bool>Whether it folds, and whether it is open the first time it is shown; a fixed heading when none.
open: Option<bool>Whether it is open, when the application keeps the state: the
panel follows it (PlacesOutput::folded says the user asked to
change it). Kept in egui’s memory when none.
empty: Option<String>The line it shows when it has no items (“No cards”): a section with one is shown empty, one without is left out.
keep: boolShown even without items or an empty line: its content comes from
PlacesPanel::under_section.
untitled: boolDrawn without a heading or a fold arrow, its rows shown directly
(PlaceSection::untitled); its title is then only the name a
screen reader gives its group.
Implementations§
Source§impl PlaceSection
impl PlaceSection
pub fn new(id: impl Into<String>, title: impl Into<String>) -> Self
Sourcepub fn untitled(id: impl Into<String>, name: impl Into<String>) -> Self
pub fn untitled(id: impl Into<String>, name: impl Into<String>) -> Self
A section without a heading: no title drawn and no fold arrow, its
rows shown directly (a library’s top rows, “All photos”, above the
titled sections). It stays one group for assistive technology,
named name (“Library”), which no one sees. Folding
(PlaceSection::foldable, PlaceSection::open) is ignored: a
section without a band has nothing to fold by.
Need (data): a list of places without a heading.
Sourcepub fn foldable(self, open_at_first: bool) -> Self
pub fn foldable(self, open_at_first: bool) -> Self
Folds under its band (egui-pop’s Fold), open at first when
open_at_first; its state kept in egui’s memory, unless the
application keeps it (PlaceSection::open).
Sourcepub fn open(self, open: bool) -> Self
pub fn open(self, open: bool) -> Self
Folds, open or not as the application keeps it: the user’s clicks
come back in PlacesOutput::folded.
Sourcepub fn empty(self, line: impl Into<String>) -> Self
pub fn empty(self, line: impl Into<String>) -> Self
The line shown when it has no items; it is then shown empty.
Sourcepub fn keep(self) -> Self
pub fn keep(self) -> Self
Shown even without items or an empty line (its content drawn by
PlacesPanel::under_section).
Sourcepub fn items(self, items: impl IntoIterator<Item = PlaceItem>) -> Self
pub fn items(self, items: impl IntoIterator<Item = PlaceItem>) -> Self
Adds items, after those it has.
Trait Implementations§
Source§impl Clone for PlaceSection
impl Clone for PlaceSection
Source§fn clone(&self) -> PlaceSection
fn clone(&self) -> PlaceSection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlaceSection
impl Debug for PlaceSection
Source§impl PartialEq for PlaceSection
impl PartialEq for PlaceSection
impl Eq for PlaceSection
impl StructuralPartialEq for PlaceSection
Auto Trait Implementations§
impl Freeze for PlaceSection
impl RefUnwindSafe for PlaceSection
impl Send for PlaceSection
impl Sync for PlaceSection
impl Unpin for PlaceSection
impl UnsafeUnpin for PlaceSection
impl UnwindSafe for PlaceSection
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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