pub trait Opts {
// Required method
fn get_pages(&self) -> Vec<Page>;
// Provided methods
fn keybinds(&self, key: KeyEvent, app: App) -> App { ... }
fn get_keywords(&self) -> Vec<&'static str> { ... }
}
Expand description
create_view function expects a Struct that implements this trait. All data and behaviour is transfered into the frontend through this.
Required Methods§
Provided Methods§
sourcefn keybinds(&self, key: KeyEvent, app: App) -> App
fn keybinds(&self, key: KeyEvent, app: App) -> App
This is called on (pretty much) every key event and how the consumer customizes the app’s behaviour. They can match on the key event and define behaviours accordindly.
sourcefn get_keywords(&self) -> Vec<&'static str>
fn get_keywords(&self) -> Vec<&'static str>
You can define words here that will take priority in search.