[][src]Struct rofi::Rofi

pub struct Rofi<'a, T> where
    T: AsRef<str>, 
{ /* fields omitted */ }

Rofi Window Builder

Rofi struct for displaying user interfaces. This struct is build after the non-consuming builder pattern. You can prepare a window, and draw it multiple times without reconstruction and reallocation. You can choose to return a handle to the child process RofiChild, which allows you to kill the process.

Implementations

impl<'a, T> Rofi<'a, T> where
    T: AsRef<str>, 
[src]

pub fn new(elements: &'a Vec<T>) -> Self[src]

Generate a new, unconfigured Rofi window based on the elements provided.

pub fn run(&self) -> Result<String, Error>[src]

Show the window, and return the selected string, including pango formatting if available

pub fn run_index(&mut self) -> Result<usize, Error>[src]

show the window, and return the index of the selected string This function will overwrite any subsequent calls to self.format.

pub fn pango(&mut self) -> &mut Self[src]

enable pango markup

pub fn password(&mut self) -> &mut Self[src]

enable password mode

pub fn lines(&mut self, l: usize) -> &mut Self[src]

Sets the number of lines. If this funciton is not called, use the number of lines provided in the elements vector.

pub fn case_sensitive(&mut self, sensitivity: bool) -> &mut Self[src]

Sets the case sensitivity (disabled by default)

pub fn prompt(&mut self, prompt: impl Into<String>) -> &mut Self[src]

Set the prompt of the rofi window

pub fn theme(&mut self, theme: Option<impl Into<String>>) -> &mut Self[src]

Set the rofi theme This will make sure that rofi uses ~/.config/rofi/{theme}.rasi

pub fn return_format(&mut self, format: Format) -> &mut Self[src]

Set the return format of the rofi call. Default is Format::Text. If you call self.spawn_index later, the format will be overwritten with Format::Index.

pub fn spawn(&self) -> Result<RofiChild<String>, Error>[src]

Returns a child process with the pre-prepared rofi window The child will produce the exact output as provided in the elements vector.

pub fn spawn_index(&mut self) -> Result<RofiChild<usize>, Error>[src]

Returns a child process with the pre-prepared rofi window. The child will produce the index of the chosen element in the vector. This function will overwrite any subsequent calls to self.format.

Trait Implementations

impl<'a, T: Debug> Debug for Rofi<'a, T> where
    T: AsRef<str>, 
[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Rofi<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for Rofi<'a, T> where
    T: Sync

impl<'a, T> Sync for Rofi<'a, T> where
    T: Sync

impl<'a, T> Unpin for Rofi<'a, T>

impl<'a, T> UnwindSafe for Rofi<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.