clipboard-rs 0.3.5

Cross-platform clipboard API (text | image | rich text | html | files | monitoring changes) | 跨平台剪贴板 API(文本|图片|富文本|html|文件|监听变化) Windows,MacOS,Linux
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use clipboard_rs::{Clipboard, ClipboardContext};

fn main() {
	let ctx = ClipboardContext::new().unwrap();
	let types = ctx.available_formats().unwrap();
	println!("{:?}", types);

	let buffer = ctx.get_buffer("public.html").unwrap();

	let string = String::from_utf8(buffer).unwrap();

	println!("{}", string);
}