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) -> DragData
pub fn with_format(self, data_type: DragDataType, data: &str) -> DragData
Add an alternative format.
Sourcepub fn with_payload<T>(self, payload: T) -> DragData
pub fn with_payload<T>(self, payload: T) -> DragData
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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more