Function terminal_clipboard::get_string
source · pub fn get_string() -> Result<String, ClipboardError>
Expand description
Return the content of the clipboard
Examples found in repository?
examples/write_read.rs (line 8)
4 5 6 7 8 9 10 11 12 13 14 15 16 17
fn main() {
println!("Clipboard backend type: {:?}", terminal_clipboard::get_type());
println!(
"Initial content of the clipboard: {:?}",
terminal_clipboard::get_string().unwrap(),
);
let s = "TEST";
println!("Writing {:?} in the clipboard", s);
terminal_clipboard::set_string(s).unwrap();
println!(
"New content of the clipboard: {:?}",
terminal_clipboard::get_string().unwrap(),
);
}