Skip to main content

Module clipboard

Module clipboard 

Source
Expand description

System clipboard read/write (Clipboard, SystemClipboard on native targets). System clipboard read/write for windowed apps (issue #296).

Windowed apps have no equivalent of the terminal backends’ bracketed-paste path (see crates/crossterm/src/lib.rs’s Event::Paste handling) for pulling text out of the clipboard on demand, nor any way to push text into it (e.g. a “copy” keybinding). This module fills that gap with a small Clipboard trait plus a native, arboard-backed SystemClipboard implementation.

Kept out of retroglyph_core::backend::Backend: clipboard access has no notion in the terminal backends this workspace also supports (crossterm, software’s headless test paths), and a windowed app that wants it can reach for this trait directly from its own update loop instead of threading it through every Backend implementation.

§Testing

The real OS clipboard (SystemClipboard) cannot be exercised headlessly in CI (no display server / clipboard manager is guaranteed to be running), so it has no automated test coverage here; it needs manual verification on each target platform instead. Clipboard is a plain trait specifically so app code (and this module’s own tests) can substitute an in-memory fake in its place; see the tests module below for an example.

Structs§

ClipboardError
Error returned by Clipboard::get_text/Clipboard::set_text.
SystemClipboard
The native OS clipboard, backed by [arboard].

Traits§

Clipboard
Read/write access to a text clipboard.