Skip to content

Commit

Permalink
4.0.0-beta.4: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DoumanAsh committed Jan 17, 2024
1 parent ca78c3b commit bdc205f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clipboard-master"
version = "4.0.0-beta.3"
version = "4.0.0-beta.4"
authors = ["Douman <[email protected]>"]
keywords = ["Windows", "winapi", "clipboard"]
description = "Simple utility crate to monitor clipboard changes"
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ This project exports `Master` struct that provides simple way to handle clipboar
Example:

```rust
extern crate clipboard_master;

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

use std::io;
Expand All @@ -38,6 +40,15 @@ impl ClipboardHandler for Handler {
}

fn main() {
let _ = Master::new(Handler).expect("Create master").run();
let mut master = Master::new(Handler).expect("create new monitor");

let shutdown = master.shutdown_channel();
std::thread::spawn(move || {
std::thread::sleep(core::time::Duration::from_secs(1));
println!("I did some work so time to finish...");
shutdown.signal();
});
//Working until shutdown
master.run().expect("Success");
}
```
13 changes: 11 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! ## Example:
//!
//! ```rust,no_run
//! ```rust
//! extern crate clipboard_master;
//!
//! use clipboard_master::{Master, ClipboardHandler, CallbackResult};
Expand All @@ -26,7 +26,16 @@
//! }
//!
//! fn main() {
//! let _ = Master::new(Handler).expect("create new monitor").run();
//! let mut master = Master::new(Handler).expect("create new monitor");
//!
//! let shutdown = master.shutdown_channel();
//! std::thread::spawn(move || {
//! std::thread::sleep(core::time::Duration::from_secs(1));
//! println!("I did some work so time to finish...");
//! shutdown.signal();
//! });
//! //Working until shutdown
//! master.run().expect("Success");
//! }
//! ```
Expand Down

0 comments on commit bdc205f

Please sign in to comment.