pub enum MimeType {
TextUtf8,
CrcblRon,
UriList,
Other(&'static str),
}Expand description
The format of a clipboard or drag-and-drop payload.
A small enum with an escape hatch rather than a bare string, so the two
formats the engine cares about cannot be misspelled, and so a match on the
interesting cases reads as one.
Variants§
TextUtf8
text/plain;charset=utf-8 — what every other application understands.
Backends must accept the text/plain spelling without the charset
parameter as equivalent when receiving, and offer the explicit
charset when sending: X11 clients in particular offer both STRING and
UTF8_STRING and mean this.
CrcblRon
application/x-crcbl+ron — the engine’s own lossless format.
Copying a scene node between two editor windows goes through this;
pasting into a text editor goes through TextUtf8,
which is why both are offered at once.
UriList
text/uri-list — file paths, the format both a file-manager drop and a
“copy file” paste arrive in.
Other(&'static str)
Anything else, by literal mime string.
&'static str rather than String keeps MimeType Copy and keeps
the whole payload type free of allocation on the send path. A backend
receiving a mime it has no variant for reports it here.