| 1 |
use arboard::Clipboard; |
| 2 |
use std::{thread, time::Duration}; |
| 3 |
|
| 4 |
fn main() { |
| 5 |
env_logger::init(); |
| 6 |
let mut ctx = Clipboard::new().unwrap(); |
| 7 |
|
| 8 |
let html = r#"<h1>Hello, World!</h1> |
| 9 |
<b>Lorem ipsum</b> dolor sit amet,<br> |
| 10 |
<i>consectetur adipiscing elit</i>."#; |
| 11 |
|
| 12 |
let alt_text = r#"Hello, World! |
| 13 |
Lorem ipsum dolor sit amet, |
| 14 |
consectetur adipiscing elit."#; |
| 15 |
|
| 16 |
ctx.set_html(html, Some(alt_text)).unwrap(); |
| 17 |
thread::sleep(Duration::from_secs(5)); |
| 18 |
|
| 19 |
let success = ctx.get().html().unwrap() == html; |
| 20 |
println!("Set and Get html operations were successful: {success}"); |
| 21 |
} |