Skip to main content

ClipboardProvider

Trait ClipboardProvider 

Source
pub trait ClipboardProvider {
    // Required methods
    fn read_text(&self) -> Option<String>;
    fn write_text(&self, text: &str);
}
Expand description

Reads and writes the system clipboard. Platform layers install one with crate::Ui::set_clipboard; until then, an in-memory clipboard is used.

Required Methods§

Source

fn read_text(&self) -> Option<String>

The clipboard’s text, or None when it is empty, not text, or cannot be read synchronously (in the browser, pasting arrives as typed text).

Source

fn write_text(&self, text: &str)

Replaces the clipboard’s content with text.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§