diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/clipboard.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/clipboard.rs b/core/src/clipboard.rs index 081b4004..ff2e31d0 100644 --- a/core/src/clipboard.rs +++ b/core/src/clipboard.rs @@ -8,6 +8,12 @@ pub trait Clipboard { /// Writes the given text contents to the [`Clipboard`]. fn write(&mut self, contents: String); + + /// Reads the current content of Primary as text. + fn read_primary(&self) -> Option<String>; + + /// Writes the given text contents to Primary. + fn write_primary(&mut self, contents: String); } /// A null implementation of the [`Clipboard`] trait. @@ -20,4 +26,10 @@ impl Clipboard for Null { } fn write(&mut self, _contents: String) {} + + fn read_primary(&self) -> Option<String> { + None + } + + fn write_primary(&mut self, _contents: String) {} } |