pub struct DirEntry {
pub display_text: String,
pub directory: String,
}Expand description
A (display-text, directory-path) pair for the directory tree pane.
Both fields are plain Strings on the same allocation as the struct.
§Turbo Vision heritage
Ports TDirEntry (filedial.cpp); its two heap-allocated char* fields
become owned Strings.
Fields§
§display_text: StringThe text rendered by DirListBox for this entry.
Built by DirListBox::build_tree: ancestor entries carry tree-glyph
prefixes (e.g. " └─┬oetiker"); the plain display name comes after
those glyphs. Typically not set by callers directly — construct via
DirEntry::new and let build_tree produce the decorated text.
directory: StringThe absolute filesystem path this entry navigates to when selected.
Used by the change-directory dialog when the user confirms a selection:
ChDirDialog::handle_event calls
DirListBox::focused_entry and reads dir() to navigate. Must be a
valid native path (no trailing separator required — the dialog normalizes
it); for the root entry use "/".
Implementations§
Source§impl DirEntry
impl DirEntry
Sourcepub fn new(
display_text: impl Into<String>,
directory: impl Into<String>,
) -> Self
pub fn new( display_text: impl Into<String>, directory: impl Into<String>, ) -> Self
Build a DirEntry from any (display_text, directory) text pair.
Use this when constructing entries for a custom dir-tree; in normal use
DirListBox::new_directory calls build_tree which produces decorated
entries automatically. display_text is what the list draws; directory
is the path navigated on selection.
Trait Implementations§
impl Eq for DirEntry
impl StructuralPartialEq for DirEntry
Auto Trait Implementations§
impl Freeze for DirEntry
impl RefUnwindSafe for DirEntry
impl Send for DirEntry
impl Sync for DirEntry
impl Unpin for DirEntry
impl UnsafeUnpin for DirEntry
impl UnwindSafe for DirEntry
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
§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.