Cross-platform clipboard sync in Rust โ€“ polling vs OS events

โš“ Rust    ๐Ÿ“… 2025-12-30    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 6      

surdeus

Hi everyone,
Iโ€™m new here and working on a personal Rust project: a local Wi-Fi clipboard sync tool for Windows (GNU based linker), Linux, and FreeBSD.

The idea is simple: detect clipboard changes on one machine and sync text/images to others on the same network. Iโ€™m keeping the core logic OS-agnostic and planning to add platform-specific backends later.

Right now Iโ€™m stuck on some design questions:

  • Most clipboard APIs donโ€™t expose metadata like last modified time
  • That seems to force polling + hashing to detect changes
  • Polling too fast wastes CPU, too slow adds latency
  • Event-based APIs exist (e.g. Windows clipboard notifications), but theyโ€™re OS-specific

My questions:

  • What polling intervals are considered reasonable in practice?
  • Is hybrid design (OS events where available + polling fallback) the right approach?
  • Are there existing Rust patterns/crates I should study for this problem?

Any guidance or real-world experience would really help. Thanks!

1 post - 1 participant

Read full topic

๐Ÿท๏ธ Rust_feed