This is a stub of the iOS clipboard logic.

This commit is contained in:
Sebastian Imlay 2019-12-21 19:57:00 -08:00
parent 22c6dd6c04
commit 958a9386c6
2 changed files with 26 additions and 0 deletions

View file

@ -2,6 +2,7 @@
unix,
not(any(
target_os = "macos",
target_os = "ios",
target_os = "android",
target_os = "emscripten"
))
@ -12,6 +13,7 @@ mod platform;
#[cfg(not(all(
unix,
not(any(
target_os = "ios",
target_os = "macos",
target_os = "android",
target_os = "emscripten"

View file

@ -15,6 +15,11 @@ pub fn new_clipboard<W: HasRawWindowHandle>(
{
Ok(Box::new(clipboard_macos::Clipboard::new()?))
}
#[cfg(target_os = "ios")]
{
Ok(Box::new(clipboard_ios::Clipboard::new()?))
}
}
#[cfg(target_os = "windows")]
@ -30,3 +35,22 @@ impl ClipboardProvider for clipboard_macos::Clipboard {
self.read()
}
}
#[cfg(target_os = "ios")]
mod clipboard_ios {
use std::error::Error;
pub struct Clipboard;
impl Clipboard {
pub fn new() -> Result<Clipboard, Box<dyn Error>> {
Ok(Self)
}
}
}
#[cfg(target_os = "ios")]
impl ClipboardProvider for clipboard_ios::Clipboard {
fn read(&self) -> Result<String, Box<dyn Error>> {
unimplemented!();
}
}