pub trait Clipboard {
Show 13 methods
// Required methods
fn read(&self) -> Option<String>;
fn write(&mut self, contents: String);
// Provided methods
fn read_primary(&self) -> Option<String> { ... }
fn write_primary(&mut self, _contents: String) { ... }
fn read_data(&self, _mimes: Vec<String>) -> Option<(Vec<u8>, String)> { ... }
fn write_data(
&mut self,
_contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>,
) { ... }
fn read_primary_data(
&self,
_mimes: Vec<String>,
) -> Option<(Vec<u8>, String)> { ... }
fn write_primary_data(
&mut self,
_contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>,
) { ... }
fn register_dnd_destination(
&self,
_surface: DndSurface,
_rectangles: Vec<DndDestinationRectangle>,
) { ... }
fn set_action(&self, _action: DndAction) { ... }
fn start_dnd(
&self,
_internal: bool,
_source_surface: Option<DndSource>,
_icon_surface: Option<Box<dyn Any>>,
_content: Box<dyn AsMimeTypes + Send>,
_actions: DndAction,
) { ... }
fn end_dnd(&self) { ... }
fn peek_dnd(&self, _mime: String) -> Option<(Vec<u8>, String)> { ... }
}
Expand description
A buffer for short-term storage and transfer within and between applications.
Required Methods§
Provided Methods§
sourcefn read_primary(&self) -> Option<String>
fn read_primary(&self) -> Option<String>
Read the current content of the primary Clipboard
as text.
sourcefn write_primary(&mut self, _contents: String)
fn write_primary(&mut self, _contents: String)
Writes the given text contents to the primary Clipboard
.
sourcefn write_data(
&mut self,
_contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>,
)
fn write_data( &mut self, _contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>, )
Writes the given contents to the Clipboard
.
sourcefn read_primary_data(&self, _mimes: Vec<String>) -> Option<(Vec<u8>, String)>
fn read_primary_data(&self, _mimes: Vec<String>) -> Option<(Vec<u8>, String)>
Consider using read_primary_data
instead
Reads the current content of the primary Clipboard
as text.
sourcefn write_primary_data(
&mut self,
_contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>,
)
fn write_primary_data( &mut self, _contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>, )
Writes the given text contents to the primary Clipboard
.
sourcefn register_dnd_destination(
&self,
_surface: DndSurface,
_rectangles: Vec<DndDestinationRectangle>,
)
fn register_dnd_destination( &self, _surface: DndSurface, _rectangles: Vec<DndDestinationRectangle>, )
Starts a DnD operation.
sourcefn set_action(&self, _action: DndAction)
fn set_action(&self, _action: DndAction)
Set the final action for the DnD operation. Only should be done if it is requested.