Trait tauri::ClipboardManager[][src]

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 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#runclosure.

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#runclosure.

You can spawn a task to use the API using tauri::async_runtime::spawn or std::thread::spawn to prevent the panic.

Implementations on Foreign Types

Implementors