Skip to main content

ListPanelSpec

Trait ListPanelSpec 

Source
pub trait ListPanelSpec {
    type Row: SearchRow + Clone + Send + Sync + 'static;

    const TITLE: &'static str;
    const HAS_FILTER: bool = true;

    // Required methods
    fn submit(row: &Self::Row, tx: &AppTx);
    fn hints() -> Vec<(String, String)>;

    // Provided method
    fn context_event(_row: &Self::Row) -> Option<AppEvent> { ... }
}
Expand description

What varies between list-shaped drawer views. The panel is the depth; each view is a thin adapter of this seam.

Required Associated Constants§

Source

const TITLE: &'static str

Panel-block title.

Provided Associated Constants§

Source

const HAS_FILTER: bool = true

Whether the top row is a typed filter input (true: every key goes to the list engine; false: only navigation keys reach the list — plain letters stay free for the host, e.g. LINKS’ b/o/u).

Required Associated Types§

Source

type Row: SearchRow + Clone + Send + Sync + 'static

Required Methods§

Source

fn submit(row: &Self::Row, tx: &AppTx)

What Enter / click-activate does with the selected row.

Source

fn hints() -> Vec<(String, String)>

Provided Methods§

Source

fn context_event(_row: &Self::Row) -> Option<AppEvent>

The event a right-click on a row fires (rows that are real notes open the file-ops menu). None = right-click selects only.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ListPanelSpec for LinksSpec

Source§

const TITLE: &'static str = "Links"

Source§

const HAS_FILTER: bool = false

Source§

type Row = LinkEntry

Source§

impl ListPanelSpec for OutlineSpec

Source§

const TITLE: &'static str = "Outline"

Source§

type Row = OutlineEntry

Source§

impl ListPanelSpec for TagsSpec

Source§

const TITLE: &'static str = "Tags"

Source§

type Row = TagEntry