Function terminal_clipboard::get_type
source · pub fn get_type() -> &'static str
Expand description
Return the type of the Clipboard, for example “X11”, “Windows”, “Local”, or “Termux”
Examples found in repository?
examples/write_read.rs (line 5)
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(),
);
}