pub struct DragData {
pub data_type: DragDataType,
pub text: String,
pub formats: HashMap<DragDataType, String>,
pub payload: Option<DragPayload>,
}Expand description
Data associated with a drag operation.
Fields§
§data_type: DragDataTypePrimary data type.
text: StringString representation of the data.
formats: HashMap<DragDataType, String>Additional data in various formats.
payload: Option<DragPayload>Custom payload (for internal transfers).
Implementations§
Source§impl DragData
impl DragData
Sourcepub fn with_format(self, data_type: DragDataType, data: &str) -> Self
pub fn with_format(self, data_type: DragDataType, data: &str) -> Self
Add an alternative format.
Sourcepub fn with_payload<T: Any + Send + Sync + Clone + 'static>(
self,
payload: T,
) -> Self
pub fn with_payload<T: Any + Send + Sync + Clone + 'static>( self, payload: T, ) -> Self
Add a payload.
Sourcepub fn get_format(&self, data_type: &DragDataType) -> Option<&str>
pub fn get_format(&self, data_type: &DragDataType) -> Option<&str>
Get data in a specific format.
Sourcepub fn has_format(&self, data_type: &DragDataType) -> bool
pub fn has_format(&self, data_type: &DragDataType) -> bool
Check if data is available in the given format.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DragData
impl !RefUnwindSafe for DragData
impl Send for DragData
impl Sync for DragData
impl Unpin for DragData
impl !UnwindSafe for DragData
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)