[][src]Trait rustofi::RustofiComponent

pub trait RustofiComponent<'a> {
    fn create_window() -> Window<'a>;
fn action(self, acb: Box<dyn FnMut(&String) -> RustofiResult>) -> Self;
fn blank(self, bcb: Box<dyn FnMut() -> RustofiResult>) -> Self;
fn actions(self, actions: Vec<String>) -> Self;
fn window(self, window: Window<'a>) -> Self;
fn display(&mut self, prompt: String) -> RustofiResult; }

Trait implemented by SearchPage and AppPage.

Required methods

fn create_window() -> Window<'a>

returns a rofi window with special initial options for the implementation

fn action(self, acb: Box<dyn FnMut(&String) -> RustofiResult>) -> Self

set the callback associated with actions

fn blank(self, bcb: Box<dyn FnMut() -> RustofiResult>) -> Self

set the callback associated with the blank entry item

fn actions(self, actions: Vec<String>) -> Self

set the optional actions to display

fn window(self, window: Window<'a>) -> Self

customize the implementation's rofi window

fn display(&mut self, prompt: String) -> RustofiResult

run the rofi command

Loading content...

Implementors

impl<'a, T: Display + Clone> RustofiComponent<'a> for AppPage<'a, T>[src]

fn create_window() -> Window<'a>[src]

create a centred single column rofi window with Pango markup enabled

fn action(self, acb: Box<dyn FnMut(&String) -> RustofiResult>) -> Self[src]

set the callback to be run when an action is selected

fn blank(self, bcb: Box<dyn FnMut() -> RustofiResult>) -> Self[src]

set the callback to be run when the blank entry is selected

fn actions(self, actions: Vec<String>) -> Self[src]

set the actions in the AppPage. This should only be called once as it overwrites the previous settings

fn window(self, window: Window<'a>) -> Self[src]

set a completely custom window

fn display(&mut self, prompt: String) -> RustofiResult[src]

run the rofi and match the selection to a RustofiResult

impl<'a, T: Display + Clone> RustofiComponent<'a> for SearchPage<'a, T>[src]

fn create_window() -> Window<'a>[src]

create a rofi window with 4 columns

fn action(self, acb: Box<dyn FnMut(&String) -> RustofiResult>) -> Self[src]

set the callback to be run when an action is selected

fn blank(self, bcb: Box<dyn FnMut() -> RustofiResult>) -> Self[src]

set the callback to be run when the blank entry is selected

fn actions(self, actions: Vec<String>) -> Self[src]

set the actions in the AppPage. This should only be called once as it overwrites the previous settings

fn window(self, window: Window<'a>) -> Self[src]

set a completely custom window

fn display(&mut self, prompt: String) -> RustofiResult[src]

display the search window and match the entry against the actions, standard items and finally if nothing matches, run the search callback

Loading content...