Function ragout::init

source ยท
pub fn init() -> (StdoutLock<'static>, Input, History, String)
Examples found in repository?
examples/default.rs (line 5)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    // enter raw mode and initialize necessary variables
    let (mut sol, mut i, mut h, mut ui) = init();
    'main: loop {
        // catch and handle user actions,
        // if input was submitted bind its value to input var
        let input = run(&mut i, &mut h, &mut sol, &mut ui);

        // reset user input to empty string
        if !input.is_empty() {
            // do some stuff with the user input
            ui.clear();
        }
    }
}