Trait ClipboardProvider

Source
pub trait ClipboardProvider: Sized {
    // Required methods
    fn new() -> Result<Self, Box<dyn Error>>;
    fn get_contents(&mut self) -> Result<String, Box<dyn Error>>;
    fn set_contents(&mut self, content: String) -> Result<(), Box<dyn Error>>;
    fn clear(&mut self) -> Result<(), Box<dyn Error>>;
}
Expand description

Trait for clipboard access

Required Methods§

Source

fn new() -> Result<Self, Box<dyn Error>>

Create a context with which to access the clipboard

Source

fn get_contents(&mut self) -> Result<String, Box<dyn Error>>

Method to get the clipboard contents as a String

Source

fn set_contents(&mut self, content: String) -> Result<(), Box<dyn Error>>

Method to set the clipboard contents as a String

Source

fn clear(&mut self) -> Result<(), Box<dyn Error>>

Method to clear the clipboard

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§