Implement stub Clipboard in iced_web

We need to figure out browser permissions and use of unstable `web-sys`
APIs
This commit is contained in:
Héctor Ramón Jiménez 2021-03-11 03:49:45 +01:00
parent a365998264
commit 7da3fb1b22
3 changed files with 38 additions and 4 deletions

21
web/src/clipboard.rs Normal file
View file

@ -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! {}
}
}