clipboard-stream 0.1.0

Async stream of clipboard change events
docs.rs failed to build clipboard-stream-0.1.0
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-stream-0.2.1

clipboard-stream

Async stream of clipboard change events.
Provides real-time clipboard monitoring through an async Stream interface.

The main part of this crate is ClipboardSream. This struct implements Stream.

Example

The following example shows how to receive clipboard items:

use clipboard_stream::ClipboardStream;
use futures::stream::StreamExt;

#[tokio::main]
async fn main() {
    let mut stream = ClipboardStream::new();

    while let Some(item) = stream.next().await {
        if let Ok(v) = item {
            println!("{}", v);
        }
    }
}

Runtime

Internally, this crate spawns a small dedicated OS thread to listen for clipboard events. The API itself is Future-based and does not depend on any specific async runtime, so it works with tokio, smol, or any runtime compatible with futures.

Platforms

  • macOS

Currently supported on macOS only. Windows support is planned for a future release.

License

clipboard-stream is provided under the MIT license.See LICENSE