clipin 0.8.1

A Rust library to get text from clipboard or stdin
Documentation

clipin

A Rust library to get text from clipboard or stdin.

Usage

Enable exactly one feature: async or sync. Returns trimmed text and optionally the clipboard instance (clipboard is None when stdin is used).

Async

cargo add clipin --features async
#[tokio::main]
async fn main() {
    let (text, clipboard) = clipin::get().await.unwrap();
    println!("{text}");
}

Sync

cargo add clipin --features sync
fn main() {
    let (text, clipboard) = clipin::get().unwrap();
    println!("{text}");
}

License

MIT. See LICENSE for details.