Skip to main content

Overlay

Trait Overlay 

Source
pub trait Overlay {
    // Required methods
    fn kind(&self) -> OverlayKind;
    fn handle_input(&mut self, event: &InputEvent, tx: &AppTx) -> EventState;
    fn render(&mut self, f: &mut Frame<'_>, area: Rect, theme: &Theme);

    // Provided methods
    fn handle_app_message(
        &mut self,
        _msg: &AppEvent,
        _vault: &Arc<NoteVault>,
        _tx: &AppTx,
    ) -> OverlayMsg { ... }
    fn hint_shortcuts(&self) -> Vec<(String, String)> { ... }
    fn query(&self) -> Option<&str> { ... }
    fn saved_search_provenance(&self) -> Option<&str> { ... }
}

Required Methods§

Source

fn kind(&self) -> OverlayKind

Source

fn handle_input(&mut self, event: &InputEvent, tx: &AppTx) -> EventState

Source

fn render(&mut self, f: &mut Frame<'_>, area: Rect, theme: &Theme)

Provided Methods§

Source

fn handle_app_message( &mut self, _msg: &AppEvent, _vault: &Arc<NoteVault>, _tx: &AppTx, ) -> OverlayMsg

Source

fn hint_shortcuts(&self) -> Vec<(String, String)>

Source

fn query(&self) -> Option<&str>

The query string this overlay holds, if it is query-backed (the note browser). Used by the editor’s save-current-query action to source the query from the active overlay. Defaults to None for non-query overlays.

Source

fn saved_search_provenance(&self) -> Option<&str>

The saved-search name this overlay’s query came from (its breadcrumb provenance), if any. Used to pre-fill the save-search dialog’s name. Defaults to None for overlays without a breadcrumb.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§