Skip to main content

DataTransferItem

Trait DataTransferItem 

Source
pub trait DataTransferItem {
    // Required methods
    fn types(&self) -> &[String];
    fn read(&self, mime: &str) -> ClipboardReadFuture;
}
Expand description

One item on the clipboard, as it was when the clipboard was listed, or of a drag (DragReport): the web’s DataTransferItem, the item its clipboard events and its drag and drop both hand over.

Required Methods§

Source

fn types(&self) -> &[String]

The forms it is offered in, by MIME type, in the order its writer gave them: the most faithful first. A file is offered as URI_LIST.

Source

fn read(&self, mime: &str) -> ClipboardReadFuture

Its content in mime, one of its types. Fails with ClipboardError::Changed if the clipboard changed since it was listed; a dragged item reads only while its drop is reported. A file promised is written into a folder of the host’s when its URI_LIST is read, and the list names it there.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§