Cross-platform clipboard sync in Rust โ polling vs OS events
โ Rust ๐ 2025-12-30 ๐ค surdeus ๐๏ธ 6Hi 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
๐ท๏ธ Rust_feed