From 7da3fb1b2225732c87aebb13a067fbdb30b0cf2d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 11 Mar 2021 03:49:45 +0100 Subject: Implement stub `Clipboard` in `iced_web` We need to figure out browser permissions and use of unstable `web-sys` APIs --- web/src/clipboard.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 web/src/clipboard.rs (limited to 'web/src/clipboard.rs') diff --git a/web/src/clipboard.rs b/web/src/clipboard.rs new file mode 100644 index 00000000..167a1e53 --- /dev/null +++ b/web/src/clipboard.rs @@ -0,0 +1,21 @@ +/// A buffer for short-term storage and transfer within and between +/// applications. +#[derive(Debug, Clone, Copy)] +pub struct Clipboard; + +impl Clipboard { + /// Creates a new [`Clipboard`]. + pub fn new() -> Self { + Self + } + + /// Reads the current content of the [`Clipboard`] as text. + pub fn read(&self) -> Option { + unimplemented! {} + } + + /// Writes the given text contents to the [`Clipboard`]. + pub fn write(&mut self, _contents: String) { + unimplemented! {} + } +} -- cgit