servo/rust-clipboard

Name: rust-clipboard

Owner: Servo

Description: X11 Clipboard interfacing library in Rust

Created: 2015-04-23 15:12:11.0

Updated: 2018-01-22 18:45:56.0

Pushed: 2016-03-22 12:46:21.0

Homepage: null

Size: 55

Language: Rust

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

rust-clipboard

rust-clipboard is a cross-platform library for getting and setting the contents of the OS-level clipboard. It has been tested on Windows, Mac OSX, and GNU/Linux. It is used in Mozilla Servo.

Example
xample() {
let mut ctx = ClipboardContext::new().unwrap();
println!("{}", ctx.get_contents());
ctx.set_contents(&"some string");

API
ew() -> Result<ClipboardContext, Box<Error>>
et_contents(&ClipboardContext) -> Result<String, Box<Error>>
et_contents(&mut ClipboardContext, String) -> Result<(), Box<Error>>

ClipboardContext is an opaque struct that is defined in different ways based on the OS via conditional compilation.

License

Since the x11 backend contains code derived from xclip (which is GPLv2), rust-clipboard must currently be treated as GPLv2. I plan to rewrite x11-clipboard.rs by strictly referencing the ICCCM standard, and relicense to Apache2. All the other code in rust-clipboard may be treated as Apache2.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.