summaryrefslogtreecommitdiffstats
path: root/web/src/clipboard.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-03-11 03:49:45 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-03-11 03:52:41 +0100
commit7da3fb1b2225732c87aebb13a067fbdb30b0cf2d (patch)
tree602a967f936bc9887f281143c63ec3d49b35fcc1 /web/src/clipboard.rs
parenta365998264420b1dac26a0de8e50ad4a33900885 (diff)
downloadiced-7da3fb1b2225732c87aebb13a067fbdb30b0cf2d.tar.gz
iced-7da3fb1b2225732c87aebb13a067fbdb30b0cf2d.tar.bz2
iced-7da3fb1b2225732c87aebb13a067fbdb30b0cf2d.zip
Implement stub `Clipboard` in `iced_web`
We need to figure out browser permissions and use of unstable `web-sys` APIs
Diffstat (limited to 'web/src/clipboard.rs')
-rw-r--r--web/src/clipboard.rs21
1 files changed, 21 insertions, 0 deletions
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<String> {
+ unimplemented! {}
+ }
+
+ /// Writes the given text contents to the [`Clipboard`].
+ pub fn write(&mut self, _contents: String) {
+ unimplemented! {}
+ }
+}