#[non_exhaustive]pub enum SendData {
Uris(Vec<String>),
String(String),
Bytes(Vec<u8>),
}Expand description
Kinds of data that can be sent via a DataTransfer.
Some kinds of data cannot be represented by just a binary blob in a cross-platform way. File URIs on Windows and macOS are represented as arrays of strings, and strings have different encoding on different platforms. To allow this to be represented, we allow supplying strings and URIs separately from binary blobs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Uris(Vec<String>)
List of URIs.
These should conform to RFC 3986. To send file
paths, convert them to file: URIs (for example with the url
crate) and pass the resulting strings here.
Note that SendData implements From<String> and From<Vec<u8>>, but not
From<Vec<String>>, as it is not necessarily obvious to a reader that Vec<String>
will be interpreted as a URI list.
String(String)
String
This can also be constructed with the From<String> implementation.
Bytes(Vec<u8>)
Binary blob
This can also be constructed with the From<Vec<u8>> implementation.