pub struct DropEvent<Id>{
pub source: Id,
pub target: Id,
pub position: DropPosition,
}Expand description
Details of a drag-and-drop event in the outliner.
This struct contains information about a completed drop operation, including the source node that was dragged, the target node it was dropped onto, and the position relative to the target.
§Generic Parameters
§Examples
ⓘ
if let Some(drop_event) = response.drop_event() {
match drop_event.position {
DropPosition::Before => {
insert_before(drop_event.source, drop_event.target);
}
DropPosition::After => {
insert_after(drop_event.source, drop_event.target);
}
DropPosition::Inside => {
make_child_of(drop_event.source, drop_event.target);
}
}
}Fields§
§source: IdThe ID of the node that was dragged.
target: IdThe ID of the node that the source was dropped onto.
position: DropPositionThe position where the source should be placed relative to the target.
Implementations§
Trait Implementations§
impl<Id> Eq for DropEvent<Id>
impl<Id> StructuralPartialEq for DropEvent<Id>
Auto Trait Implementations§
impl<Id> Freeze for DropEvent<Id>where
Id: Freeze,
impl<Id> RefUnwindSafe for DropEvent<Id>where
Id: RefUnwindSafe,
impl<Id> Send for DropEvent<Id>where
Id: Send,
impl<Id> Sync for DropEvent<Id>where
Id: Sync,
impl<Id> Unpin for DropEvent<Id>where
Id: Unpin,
impl<Id> UnwindSafe for DropEvent<Id>where
Id: UnwindSafe,
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