Trait tauri_runtime::ClipboardManager [−][src]
pub trait ClipboardManager: Debug {
fn write_text<T: Into<String>>(&mut self, text: T) -> Result<()>;
fn read_text(&self) -> Result<Option<String>>;
}
Expand description
Clipboard manager.
Required methods
Writes the text into the clipboard as plain text.
Panics
- Panics if the event loop is not running yet, usually when called on the
tauri::Builder#setup
closure. - Panics when called on the main thread, usually on the
tauri::App#run
closure.
You can spawn a task to use the API using tauri::async_runtime::spawn
or std::thread::spawn
to prevent the panic.
Read the content in the clipboard as plain text.
Panics
- Panics if the event loop is not running yet, usually when called on the
tauri::Builder#setup
closure. - Panics when called on the main thread, usually on the
tauri::App#run
closure.
You can spawn a task to use the API using tauri::async_runtime::spawn
or std::thread::spawn
to prevent the panic.