Trait copypasta::Load
[−]
[src]
pub trait Load: Sized { type Err: Error + Send + Sync + 'static; fn new() -> Result<Self, Self::Err>; fn load_primary(&self) -> Result<String, Self::Err>; fn load_selection(&self) -> Result<String, Self::Err> { ... } fn load(&self, buffer: Buffer) -> Result<String, Self::Err> { ... } }
Types that can get the system clipboard contents
Associated Types
type Err: Error + Send + Sync + 'static
Errors encountered when working with a clipboard. Each implementation is allowed to define its own error type, but it must conform to std error.
Required Methods
fn new() -> Result<Self, Self::Err>
Create a clipboard
fn load_primary(&self) -> Result<String, Self::Err>
Get the primary clipboard contents.
Provided Methods
fn load_selection(&self) -> Result<String, Self::Err>
Get the clipboard selection contents.
On most platforms, this doesn't mean anything. A default implementation is provided which uses the primary clipboard.