#[non_exhaustive]pub struct PlaceItem {Show 17 fields
pub id: String,
pub name: String,
pub path: Option<PathBuf>,
pub icon: Option<String>,
pub icon_tip: Option<String>,
pub badge_icon: Option<PlaceBadgeIcon>,
pub image: Option<PlaceImage>,
pub detail: Option<String>,
pub badge: Option<String>,
pub badge_tone: Option<Tone>,
pub line: Option<String>,
pub toggle: Option<PlaceToggle>,
pub children: Vec<PlaceItem>,
pub open_at_first: bool,
pub open: Option<bool>,
pub dimmed: bool,
pub segments: Vec<PlaceSegment>,
}Expand description
One place of a PlaceSection: a folder, a volume, or an application’s
own (a card, an account of a service). Made with PlaceItem::new or
PlaceItem::folder and its builders.
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 in its section: what a panel says was chosen.
name: StringIts name, shown and said.
path: Option<PathBuf>The folder it opens, if it is one: the picker lists only those.
icon: Option<String>An icon of the icon registry (phosphor:sd-card), before its name:
what kind of place it is.
icon_tip: Option<String>The icon’s tooltip, said in the item’s description (Network node).
badge_icon: Option<PlaceBadgeIcon>A second, smaller icon on the corner of PlaceItem::icon: the
place’s state (a struck cloud for an offline node), its tooltip
said in the item’s description (PlaceItem::badge_icon).
image: Option<PlaceImage>An image in the icon’s place (a detected camera’s photo), drawn at
the icon’s size; the icon stands in while it loads or if it fails
(PlaceItem::image).
detail: Option<String>A line about it, in its tip (a card’s free space); its path when none.
badge: Option<String>A short mark after its name (a count, “new”), said with it.
badge_tone: Option<Tone>The badge’s tone (a warning ▲ on an account to reconnect); plain small text when none.
line: Option<String>A line shown under its name, always visible (a path, a card’s free space, “needs reconnecting”): why in a word, on the item itself. Said as the item’s description.
toggle: Option<PlaceToggle>A toggle of the application’s at the item’s end (a pin):
PlacesOutput::toggled says it was clicked.
children: Vec<PlaceItem>The items nested under it (a folder’s subfolders, a keyword’s
narrower ones), shown indented under it while it is open: a panel
then draws its section as a tree (PlaceItem::children).
open_at_first: boolWhether it is open the first time it is shown, when it has children (no by default).
open: Option<bool>Whether it is open, when the application keeps the state: the
panel follows it (PlacesOutput::expanded says the user asked to
change it). Kept in egui’s memory when none.
dimmed: boolDrawn muted (a folder of an offline volume): its name, line, badge and icon in the muted text role, said to be unavailable. It stays choosable, its detail still in its tip.
segments: Vec<PlaceSegment>Its name as a compacted chain (a / b / c, folders with one
child each drawn on one row): each segment its own click target,
underlined under the pointer (PlaceItem::segments). None: its
name, drawn whole.
Implementations§
Source§impl PlaceItem
impl PlaceItem
Sourcepub fn new(id: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, name: impl Into<String>) -> Self
An item that is no folder: the application acts on it.
Sourcepub fn folder(name: impl Into<String>, path: impl Into<PathBuf>) -> Self
pub fn folder(name: impl Into<String>, path: impl Into<PathBuf>) -> Self
A folder, its id its path.
pub fn path(self, path: impl Into<PathBuf>) -> Self
pub fn icon(self, icon: impl Into<String>) -> Self
Sourcepub fn icon_tip(self, tip: impl Into<String>) -> Self
pub fn icon_tip(self, tip: impl Into<String>) -> Self
The icon’s tooltip (see PlaceItem::icon_tip): what kind of
place it is, in words.
Sourcepub fn badge_icon(self, icon: impl Into<String>, tip: impl Into<String>) -> Self
pub fn badge_icon(self, icon: impl Into<String>, tip: impl Into<String>) -> Self
A state badge on the corner of the kind icon: an icon of the icon
registry (phosphor:cloud-slash) and its tooltip (Offline), the
tooltip shown when the pointer is on the badge and said in the
item’s description. The kind icon stays what the item is; the badge
says how it is. Without a kind icon the badge takes its place.
Need (state): a place shown by its kind with its state on it (a node glyph with an offline mark).
Sourcepub fn image(self, image: impl Into<ImageSource<'static>>) -> Self
pub fn image(self, image: impl Into<ImageSource<'static>>) -> Self
An image in the icon’s place: a texture the application loaded
(egui::load::SizedTexture), or a URI egui’s image loaders read
(file://, bytes://, https://). It fills the icon’s square,
cropped to its middle and rounded as the theme rounds widgets; the
item’s icon is drawn while it loads or if it
fails. The item is still said by its name.
Need (image): a place shown by its picture (a camera’s photo) in a places list.
pub fn detail(self, detail: impl Into<String>) -> Self
pub fn badge(self, badge: impl Into<String>) -> Self
Sourcepub fn badge_tone(self, tone: Tone) -> Self
pub fn badge_tone(self, tone: Tone) -> Self
The badge’s tone (see PlaceItem::badge_tone).
Sourcepub fn line(self, line: impl Into<String>) -> Self
pub fn line(self, line: impl Into<String>) -> Self
A line under its name, always shown (see PlaceItem::line).
Sourcepub fn toggle(self, toggle: PlaceToggle) -> Self
pub fn toggle(self, toggle: PlaceToggle) -> Self
A toggle at its end (see PlaceToggle).
Sourcepub fn children(self, children: impl IntoIterator<Item = PlaceItem>) -> Self
pub fn children(self, children: impl IntoIterator<Item = PlaceItem>) -> Self
Items nested under it, after those it has: a branch of a tree
(volume, folder, subfolders; Animals, Dog). A panel indents
them by depth under a disclosure toggle named after the item (“Show
or hide Animals”); Right opens it and Left folds it while the item
has the keyboard, and Up and Down go through the rows shown. Each
item is said at its level, a branch as expanded or not.
Need (data): a tree of places in a side panel (folders and their subfolders, nested keywords).
Sourcepub fn open_at_first(self, open: bool) -> Self
pub fn open_at_first(self, open: bool) -> Self
Whether a branch is open the first time it is shown; its state is
then kept in egui’s memory (see PlaceItem::open).
Sourcepub fn open(self, open: bool) -> Self
pub fn open(self, open: bool) -> Self
A branch open or not as the application keeps it: the user’s clicks
and arrows come back in PlacesOutput::expanded.
Sourcepub fn dimmed(self, dimmed: bool) -> Self
pub fn dimmed(self, dimmed: bool) -> Self
Drawn muted and said to be unavailable (see PlaceItem::dimmed):
an offline volume’s folders, still choosable.
Need (state): a place shown out of reach but still choosable (a folder of an offline volume).
Sourcepub fn segments(self, segments: impl IntoIterator<Item = PlaceSegment>) -> Self
pub fn segments(self, segments: impl IntoIterator<Item = PlaceSegment>) -> Self
Its name drawn as a compacted chain, a / b / c (egui-pop draws
the separator, SEGMENT_SEPARATOR): each segment underlined
under the pointer, its own click target and its own node for
assistive technology, named by the chain up to it (a / b) or
its PlaceSegment::name. A click on a segment is reported in
PlacesOutput::segment, not as the item chosen: the
application decides what it does. The row keeps its selection,
hover highlight, keyboard (Enter chooses the item) and tip, and is
still said by PlaceItem::name (give it the whole chain).
Need (data): a tree row of compacted folders (a / b / c) whose each folder is clickable.
Trait Implementations§
impl Eq for PlaceItem
impl StructuralPartialEq for PlaceItem
Auto Trait Implementations§
impl Freeze for PlaceItem
impl RefUnwindSafe for PlaceItem
impl Send for PlaceItem
impl Sync for PlaceItem
impl Unpin for PlaceItem
impl UnsafeUnpin for PlaceItem
impl UnwindSafe for PlaceItem
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