pub struct ListingEntry {
pub path: PathBuf,
pub is_dir: bool,
pub icon_byte: u32,
pub name_byte_len: u32,
}Expand description
One row of a listing, in the shape entry presentation needs: where it points and whether it is a directory.
This is the type the minor and both majors share. It exists because
activation alone needs no dependency between them — the
[ActivationPolicy] names major ids — but the entry data does:
the mode has to know, per row, what to draw an icon for. Both majors
already modelled this, differently
(crate::oil::OilEntry as { name, is_dir },
crate::file_tree::FileTreeEntry as { path, depth, kind }), and
converging those two onto this one is DL.6.
Fields§
§path: PathBufPath the row refers to. Absolute where the major knows the directory; otherwise a bare file name, which is enough for the icon lookup (it inspects only the file name and extension).
is_dir: bool§icon_byte: u32Byte offset within the row where the icon is spliced.
0 for a flat listing (oil), whose rows are bare filenames.
The file tree indents and prefixes an expand marker, so its
icon anchors after those — at byte 0 the glyph would land to
the left of the indent and the tree’s shape would collapse.
name_byte_len: u32Byte length of the entry NAME, which begins at Self::icon_byte
(the icon is virtual text and occupies no source byte).
Carried rather than re-derived, because neither the path nor the
icon anchor is enough to recover it. path.file_name() is wrong
for the tree’s root row, whose text is the whole path; and
“icon_byte to end of line” needs the rope, which would put a
per-publish as_string() of the entire listing on the actor
thread to learn something both majors already computed when they
rendered the row.
Trait Implementations§
Source§impl Clone for ListingEntry
impl Clone for ListingEntry
Source§fn clone(&self) -> ListingEntry
fn clone(&self) -> ListingEntry
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 ListingEntry
impl Debug for ListingEntry
impl Eq for ListingEntry
Source§impl PartialEq for ListingEntry
impl PartialEq for ListingEntry
impl StructuralPartialEq for ListingEntry
Auto Trait Implementations§
impl Freeze for ListingEntry
impl RefUnwindSafe for ListingEntry
impl Send for ListingEntry
impl Sync for ListingEntry
impl Unpin for ListingEntry
impl UnsafeUnpin for ListingEntry
impl UnwindSafe for ListingEntry
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<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.