Skip to content

Commit

Permalink
v0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ChurchTao committed Sep 20, 2024
1 parent 7c73b43 commit bc8c117
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## v0.2.1 (2024-08-26) [released]

### zh:

- 增加 X11 启动参数,自定义读取的超时时间 [issues#45](https://github.com/ChurchTao/clipboard-rs/issues/45)

### en:

- Add X11 startup parameters to customize the timeout for reading [issues#45](https://github.com/ChurchTao/clipboard-rs/issues/45)

## v0.2.0 (2024-08-25) [released]

### zh:
Expand Down
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-rs"
version = "0.2.0"
version = "0.2.1"
authors = ["ChurchTao <swkzymlyy@gmail.com>"]
description = "Cross-platform clipboard API (text | image | rich text | html | files | monitoring changes) | 跨平台剪贴板 API(文本|图片|富文本|html|文件|监听变化) Windows,MacOS,Linux"
repository = "https://github.com/ChurchTao/clipboard-rs"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Add the following content to your `Cargo.toml`:

```toml
[dependencies]
clipboard-rs = "0.2.0"
clipboard-rs = "0.2.1"
```

## [CHANGELOG](CHANGELOG.md)
Expand Down Expand Up @@ -175,7 +175,7 @@ fn main() {

## X11 - Clipboard Read Timeout

By default, in X11 clipboard-rs implements a read timeout of 500 ms. You can override or disable this timeout by creating **ClipboardContext** using `new_with_options`:
By default, in X11 clipboard-rs implements a read timeout of 500 ms. You can override or disable this timeout by creating **ClipboardContext** using `new_with_options`:

```rust
#[cfg(unix)]
Expand Down
18 changes: 17 additions & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ clipboard-rs 是一个用 Rust 语言编写的跨平台库,用于获取和设

```toml
[dependencies]
clipboard-rs = "0.2.0"
clipboard-rs = "0.2.1"
```

## [更新日志](CHANGELOG.md)
Expand Down Expand Up @@ -166,6 +166,22 @@ fn main() {

```

## X11 - 读取超时设定

默认读取超时时间为 500ms,但是遇到大图片,等数据流比较大的东西时,有可能就读取中断失败了。你可以通过 **ClipboardContext** `new_with_options` 重设超时时间:

```rust
#[cfg(unix)]
fn setup_clipboard() -> ClipboardContext {
ClipboardContext::new_with_options(ClipboardContextX11Options { read_timeout: None }).unwrap()
}

#[cfg(not(unix))]
fn setup_clipboard(ctx: &mut ClipboardContext) -> ClipboardContext{
ClipboardContext::new().unwrap()
}
```

## 贡献

欢迎提交 PR 和 issue,为项目贡献你的代码或者想法。由于本人水平有限,库也可能会有 bug,欢迎大家指出,我会第一时间修改。
Expand Down

0 comments on commit bc8c117

Please sign in to comment.