Skip to main content

FileRow

Trait FileRow 

pub trait FileRow: 'static {
    // Required methods
    fn path(&self) -> &Path;
    fn name(&self) -> &str;
    fn is_dir(&self) -> bool;
    fn size_text(&self) -> String;
    fn modified(&self) -> Option<DateTime<Local>>;

    // Provided methods
    fn kind(&self) -> Option<String> { ... }
    fn paint_name(
        &self,
        scene: &mut Scene,
        transform: Affine,
        theme: &Theme,
        text_renderer: &mut TextRenderer,
        cell: Rect,
        metrics: &FileTableMetrics,
    ) { ... }
}
Expand description

One row of a file list: a file or a folder.

Required Methods§

fn path(&self) -> &Path

Where the entry is; also the row’s identity across rebuilds.

fn name(&self) -> &str

The name the row shows.

fn is_dir(&self) -> bool

fn size_text(&self) -> String

The Size column: a file’s size, or what a folder holds once counted (blank until then).

fn modified(&self) -> Option<DateTime<Local>>

When the entry last changed, if known.

Provided Methods§

fn kind(&self) -> Option<String>

What kind of thing the entry is, for a list of things that are not files (an app: Flatpak, AppImage, …). A list any of whose rows has a kind shows a Kind column where it would show when each changed.

fn paint_name( &self, scene: &mut Scene, transform: Affine, theme: &Theme, text_renderer: &mut TextRenderer, cell: Rect, metrics: &FileTableMetrics, )

Paint the name cell. The default is the file’s icon and its name, which is all a list without previews needs.

Implementors§