pub struct DirListing {
pub path: String,
pub display_path: String,
pub parent: Option<String>,
pub entries: Vec<DirEntryInfo>,
}Expand description
The result of a successful list_dir — everything screen 7a needs to
render one view of the picker.
Why: a bare Vec<DirEntryInfo> would force the client to re-derive
navigation state it cannot compute without filesystem access it does not
have. The listed directory has to describe itself: where it resolved to
(path — ~/.. are resolved server-side), how to caption it (display_path),
and where “up” goes (parent).
What: path is the canonical absolute directory; display_path is path
with the home prefix collapsed back to ~ for the breadcrumb (7a shows
~/code / acme-api /, which the client renders by splitting this on /);
parent is None only at the filesystem root, which is precisely when the
client must disable its up-affordance.
Test: tests::listing_shape_supports_breadcrumb_and_badges,
tests::parent_is_none_at_filesystem_root.
Fields§
§path: StringCanonical absolute path of the directory that was listed.
display_path: Stringpath with the user’s home collapsed to ~ — the breadcrumb caption.
parent: Option<String>Absolute path of the parent, or None at the filesystem root.
entries: Vec<DirEntryInfo>Entries, directories first, then case-insensitively by name.
Trait Implementations§
Source§impl Clone for DirListing
impl Clone for DirListing
Source§fn clone(&self) -> DirListing
fn clone(&self) -> DirListing
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DirListing
impl Debug for DirListing
impl Eq for DirListing
Source§impl PartialEq for DirListing
impl PartialEq for DirListing
Source§impl Serialize for DirListing
impl Serialize for DirListing
impl StructuralPartialEq for DirListing
Auto Trait Implementations§
impl Freeze for DirListing
impl RefUnwindSafe for DirListing
impl Send for DirListing
impl Sync for DirListing
impl Unpin for DirListing
impl UnsafeUnpin for DirListing
impl UnwindSafe for DirListing
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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