Trait tauri::ClipboardManager
pub trait ClipboardManager: Debug {
fn write_text<T>(&mut self, text: T) -> Result<(), Error>
where
T: Into<String>;
fn read_text(&self) -> Result<Option<String>, Error>;
}
Expand description
Clipboard manager.
#
Required methodswrite_text<T>(&mut self, text: T) -> Result<(), Error> where T: Into<String>,#
fnWrites 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_text(&self) -> Result<Option<String>, Error>#
fnRead 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.