# rust-clipboard **Repository Path**: mirrors_servo/rust-clipboard ## Basic Information - **Project Name**: rust-clipboard - **Description**: X11 Clipboard interfacing library in Rust - **Primary Language**: Unknown - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2026-02-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## 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 ```rust fn example() { let mut ctx = ClipboardContext::new().unwrap(); println!("{}", ctx.get_contents()); ctx.set_contents(&"some string"); } ``` ## API ```rust fn new() -> Result> fn get_contents(&ClipboardContext) -> Result> fn set_contents(&mut ClipboardContext, String) -> Result<(), Box> ``` `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.