[−][src]Struct stdweb::web::event::DataTransfer
The DataTransfer object is used to hold the data that is being dragged during a drag and drop operation.
It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API.
Methods
impl DataTransfer
[src]
pub fn drop_effect(&self) -> DropEffect
[src]
Gets the type of drag-and-drop operation currently selected type. The value must be none, copy, link or move.
pub fn set_drop_effect(&self, value: DropEffect)
[src]
Sets the type of drag-and-drop operation currently selected. The value must be none, copy, link or move.
pub fn effect_allowed(&self) -> EffectAllowed
[src]
Provides all of the types of operations that are possible. Must be one of none, copy, copyLink, copyMove, link, linkMove, move, all or uninitialized.
pub fn set_effect_allowed(&self, value: EffectAllowed)
[src]
Sets the effect that is allowed for a drag operation. Must be one of none, copy, copyLink, copyMove, link, linkMove, move, all or uninitialized.
pub fn items(&self) -> DataTransferItemList
[src]
Gives a DataTransferItemList object which is a list of all of the drag data.
pub fn files(&self) -> FileList
[src]
Contains a list of all the local files available on the data transfer. If the drag operation doesn't involve dragging files, this property is an empty list.
pub fn types(&self) -> Vec<String>
[src]
An array of strings giving the formats that were set in the dragstart event.
pub fn clear_data(&self, format: Option<&str>)
[src]
Remove the data associated with a given type. The type argument is optional. If the type is empty or not specified, the data associated with all types is removed. If data for the specified type does not exist, or the data transfer contains no data, this method will have no effect.
pub fn get_data(&self, format: &str) -> String
[src]
Retrieves the data for a given type, or an empty string if data for that type does not exist or the data transfer contains no data.
pub fn set_data(&self, format: &str, data: &str)
[src]
Set the data for a given type. If data for the type does not exist, it is added at the end, such that the last item in the types list will be the new format. If data for the type already exists, the existing data is replaced in the same position.
pub fn set_drag_image(&self, img: &ImageElement, x_offset: i32, y_offset: i32)
[src]
Set the image to be used for dragging if a custom one is desired.
Trait Implementations
impl JsSerialize for DataTransfer
[src]
impl TryFrom<DataTransfer> for Reference
[src]
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: DataTransfer) -> Result<Self, Self::Error>
[src]
impl TryFrom<Reference> for DataTransfer
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>
[src]
impl<'_r> TryFrom<&'_r Reference> for DataTransfer
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
[src]
impl TryFrom<Value> for DataTransfer
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>
[src]
impl<'_r> TryFrom<&'_r Value> for DataTransfer
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>
[src]
impl InstanceOf for DataTransfer
[src]
fn instance_of(reference: &Reference) -> bool
[src]
impl ReferenceType for DataTransfer
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
impl AsRef<Reference> for DataTransfer
[src]
impl From<DataTransfer> for Reference
[src]
fn from(value: DataTransfer) -> Self
[src]
impl Clone for DataTransfer
[src]
fn clone(&self) -> DataTransfer
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for DataTransfer
[src]
impl PartialEq<DataTransfer> for DataTransfer
[src]
fn eq(&self, other: &DataTransfer) -> bool
[src]
fn ne(&self, other: &DataTransfer) -> bool
[src]
impl Debug for DataTransfer
[src]
Auto Trait Implementations
impl Send for DataTransfer
impl Sync for DataTransfer
impl Unpin for DataTransfer
impl UnwindSafe for DataTransfer
impl RefUnwindSafe for DataTransfer
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,