clipboard-master 3.1.1

Simple utility crate to monitor clipboard changes
docs.rs failed to build clipboard-master-3.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: clipboard-master-4.0.0-beta.5

clipboard-master

Crates.io Docs.rs

Clipboard monitoring library.

Supported platforms

  • Windows - uses dummy window to receive messages when clipboard changes;
  • Linux - uses x11_clipboard
  • MacOS - uses polling via NSPasteboard::changeCount as there is no event notification.

Clipboard Master Library

This project exports Master struct that provides simple way to handle clipboard updates.

Example:

use clipboard_master::{Master, ClipboardHandler, CallbackResult};

use std::io;

struct Handler;

impl ClipboardHandler for Handler {
    fn on_clipboard_change(&mut self) -> CallbackResult {
        println!("Clipboard change happened!");
        CallbackResult::Next
    }

    fn on_clipboard_error(&mut self, error: io::Error) -> CallbackResult {
        eprintln!("Error: {}", error);
        CallbackResult::Next
    }
}

fn main() {
    let _ = Master::new(Handler).run();
}