Crates.io | alternate_screen_wrapper |
lib.rs | alternate_screen_wrapper |
version | 0.1.1 |
source | src |
created_at | 2024-08-09 15:09:27.195498 |
updated_at | 2024-10-03 05:51:11.357625 |
description | enter end leave alternate screen in one line |
homepage | |
repository | |
max_upload_size | |
id | 1330999 |
size | 4,143 |
Cargo.toml
alternate_screen_wraper = { version = "<current-version>", features = "crossterm" } # or other backand
main.rs
fn main() {
let alternate_screen = alternater_screen_wrapper::AlternateScreen::enter();
// ..do some work
let printable = // do other work
//
drop(alternate_screen);
println!("{printable}"); // it works
}
You can don't call drop manually. It will be dropped automatically when you exiting scope or panicing.