pub struct DragDropTarget<'ui>(/* private fields */);Expand description
Drag drop target for accepting payloads
This struct is created by Ui::drag_drop_target and provides
methods for accepting different types of payloads.
Implementations§
Source§impl<'ui> DragDropTarget<'ui>
impl<'ui> DragDropTarget<'ui>
Sourcepub fn accept_payload_empty(
&self,
name: impl AsRef<str>,
flags: DragDropFlags,
) -> Option<DragDropPayloadEmpty>
pub fn accept_payload_empty( &self, name: impl AsRef<str>, flags: DragDropFlags, ) -> Option<DragDropPayloadEmpty>
Accept an empty payload
This is the safest option for drag and drop operations. Use this when you only need to know that a drop occurred, not transfer actual data.
§Arguments
name- Payload type name (must match source name)flags- Accept flags
Returns payload info if accepted, None otherwise.
Sourcepub fn accept_payload<T: 'static + Copy, Name: AsRef<str>>(
&self,
name: Name,
flags: DragDropFlags,
) -> Option<Result<DragDropPayloadPod<T>, PayloadIsWrongType>>
pub fn accept_payload<T: 'static + Copy, Name: AsRef<str>>( &self, name: Name, flags: DragDropFlags, ) -> Option<Result<DragDropPayloadPod<T>, PayloadIsWrongType>>
Accept a typed payload
Attempts to accept a payload with the specified type.
Returns Ok(payload) if the type matches, Err(PayloadIsWrongType) if not.
§Arguments
name- Payload type name (must match source name)flags- Accept flags
Returns Some(Result<payload, error>) if payload exists, None otherwise.
Sourcepub unsafe fn accept_payload_unchecked(
&self,
name: impl AsRef<str>,
flags: DragDropFlags,
) -> Option<DragDropPayload>
pub unsafe fn accept_payload_unchecked( &self, name: impl AsRef<str>, flags: DragDropFlags, ) -> Option<DragDropPayload>
Trait Implementations§
Source§impl<'ui> Debug for DragDropTarget<'ui>
impl<'ui> Debug for DragDropTarget<'ui>
Auto Trait Implementations§
impl<'ui> Freeze for DragDropTarget<'ui>
impl<'ui> !RefUnwindSafe for DragDropTarget<'ui>
impl<'ui> !Send for DragDropTarget<'ui>
impl<'ui> !Sync for DragDropTarget<'ui>
impl<'ui> Unpin for DragDropTarget<'ui>
impl<'ui> !UnwindSafe for DragDropTarget<'ui>
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