<h1>rust-clipboard</h1>
<p>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.</p>
<h2>Example</h2>
<pre><code>fn example() {
let mut ctx = ClipboardContext::new().unwrap();
println!("{}", ctx.get_contents());
ctx.set_contents("some string");
}
</code></pre>
<h2>API</h2>
<pre><code>new() -> Result<ClipboardContext, Box<Error>>
get_contents(&ClipboardContext) -> Result<String, Box<Error>>
set_contents(&mut ClipboardContext, String) -> Result<(), Box<Error>>
</code></pre>
<p><code>ClipboardContext</code> is an opaque struct that is defined in different ways based on the OS via conditional compilation.</p>
<h2>License</h2>
<p>Since the x11 backend contains code derived from xclip (which is GPLv2), rust-clipboard is also GPLv2.</p>