pub struct DataTransfer { /* private fields */ }Expand description
DataTransfer: the data of a clipboard or drag operation, by format (a
MIME type), in the order each format was first set, and its files.
It is shared as a DOM DataTransfer is, so its setters take &self: a
copy fills the one the platform’s clipboard event carries, and the
caller reads it afterwards.
Implementations§
Source§impl DataTransfer
impl DataTransfer
Sourcepub fn types(&self) -> Vec<String>
pub fn types(&self) -> Vec<String>
types: the formats set so far, in order, then "Files" when there
are files, as browsers report it.
Sourcepub fn set_data(&self, format: &str, data: &str)
pub fn set_data(&self, format: &str, data: &str)
setData(format, data): sets the data for format, keeping its
place if it was set before.
Sourcepub fn clear_data(&self, format: Option<&str>)
pub fn clear_data(&self, format: Option<&str>)
clearData(format): removes the data for format, or with None
all of it (not the files).
Sourcepub fn files(&self) -> Vec<DataTransferFile>
pub fn files(&self) -> Vec<DataTransferFile>
files.
Sourcepub fn set_files(&self, files: Vec<DataTransferFile>)
pub fn set_files(&self, files: Vec<DataTransferFile>)
Sets files (what items.add(file) builds up in a browser).
Sourcepub fn drop_effect(&self) -> String
pub fn drop_effect(&self) -> String
dropEffect ("none" at first).
pub fn set_drop_effect(&self, drop_effect: &str)
Sourcepub fn effect_allowed(&self) -> String
pub fn effect_allowed(&self) -> String
effectAllowed ("uninitialized" at first).
pub fn set_effect_allowed(&self, effect_allowed: &str)
Trait Implementations§
Source§impl Debug for DataTransfer
impl Debug for DataTransfer
Auto Trait Implementations§
impl !Freeze for DataTransfer
impl !RefUnwindSafe for DataTransfer
impl !Send for DataTransfer
impl !Sync for DataTransfer
impl !UnwindSafe for DataTransfer
impl Forget for DataTransfer
impl Move for DataTransfer
impl Unpin for DataTransfer
impl UnsafeUnpin for DataTransfer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more