pub enum DragPayload {
Text(String),
Image {
handle: ImageHandle,
region: Option<Rect>,
},
Custom {
kind: Arc<str>,
data: Arc<dyn Any + Send + Sync>,
},
}Variants§
Implementations§
Source§impl DragPayload
impl DragPayload
pub fn text(text: impl Into<String>) -> Self
pub fn image(handle: ImageHandle) -> Self
pub fn image_region(handle: ImageHandle, region: Rect) -> Self
pub fn custom<T>(kind: impl Into<Arc<str>>, data: T) -> Self
pub fn as_text(&self) -> Option<&str>
pub fn custom_kind(&self) -> Option<&str>
pub fn custom_data<T>(&self) -> Option<&T>
Trait Implementations§
Source§impl Clone for DragPayload
impl Clone for DragPayload
Source§impl Debug for DragPayload
impl Debug for DragPayload
Auto Trait Implementations§
impl !RefUnwindSafe for DragPayload
impl !UnwindSafe for DragPayload
impl Forget for DragPayload
impl Freeze for DragPayload
impl Move for DragPayload
impl Send for DragPayload
impl Sync for DragPayload
impl Unpin for DragPayload
impl UnsafeUnpin for DragPayload
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