Function term_basics_linux::flush
source · Expand description
Flushes stdout. When you do print! or term-basics-linux equivalent, it will not print immediately. For example if you print! and then input_field(), it will print after you typed in the input. flush() will make sure everything is printed first.
Example
use std::io::Write; //flush stdout
use term_basics_linux as tbl;
print!("type: ");
tbl::flush().expect("oh no");
let x = tbl::input_field();
This example is the same as let x = tbl::prompt("type: ");