pub trait Clipboard {
    // Required methods
    fn read(&self, kind: Kind) -> Option<String>;
    fn write(&mut self, kind: Kind, contents: String);
    // Provided methods
    fn read_data(
        &self,
        _kind: Kind,
        _mimes: Vec<String>,
    ) -> Option<(Vec<u8>, String)> { ... }
    fn write_data(
        &mut self,
        _kind: Kind,
        _contents: ClipboardStoreData<Box<dyn AsMimeTypes + Sync + Send>>,
    ) { ... }
    fn register_dnd_destination(
        &self,
        _surface: DndSurface,
        _rectangles: Vec<DndDestinationRectangle>,
    ) { ... }
    fn set_action(&self, _action: DndAction) { ... }
    fn start_dnd(
        &mut self,
        _internal: bool,
        _source_surface: Option<DndSource>,
        _icon_surface: Option<IconSurface<Box<dyn Any>>>,
        _content: Box<dyn AsMimeTypes + Send>,
        _actions: DndAction,
    ) { ... }
    fn end_dnd(&self) { ... }
    fn peek_dnd(&self, _mime: String) -> Option<(Vec<u8>, String)> { ... }
    fn request_logical_window_size(&self, _width: f32, _height: f32) { ... }
}Expand description
A buffer for short-term storage and transfer within and between applications.
Required Methods§
Provided Methods§
Sourcefn write_data(
    &mut self,
    _kind: Kind,
    _contents: ClipboardStoreData<Box<dyn AsMimeTypes + Sync + Send>>,
)
 
fn write_data( &mut self, _kind: Kind, _contents: ClipboardStoreData<Box<dyn AsMimeTypes + Sync + Send>>, )
Writes the given contents to the 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.
Sourcefn start_dnd(
    &mut self,
    _internal: bool,
    _source_surface: Option<DndSource>,
    _icon_surface: Option<IconSurface<Box<dyn Any>>>,
    _content: Box<dyn AsMimeTypes + Send>,
    _actions: DndAction,
)
 
fn start_dnd( &mut self, _internal: bool, _source_surface: Option<DndSource>, _icon_surface: Option<IconSurface<Box<dyn Any>>>, _content: Box<dyn AsMimeTypes + Send>, _actions: DndAction, )
Registers Dnd destinations
Sourcefn peek_dnd(&self, _mime: String) -> Option<(Vec<u8>, String)>
 
fn peek_dnd(&self, _mime: String) -> Option<(Vec<u8>, String)>
Consider using peek_dnd instead
Peeks the data on the DnD with a specific mime type.
Will return an error if there is no ongoing DnD operation.
Sourcefn request_logical_window_size(&self, _width: f32, _height: f32)
 
fn request_logical_window_size(&self, _width: f32, _height: f32)
Request window size