pub trait DropTarget {
// Required methods
fn can_accept(&self, data: &DragData) -> DropEffect;
fn accept_drop(
&mut self,
data: &DragData,
effect: DropEffect,
) -> Result<bool, UiError>;
}Expand description
Something that can accept a drop.
Required Methods§
Sourcefn can_accept(&self, data: &DragData) -> DropEffect
fn can_accept(&self, data: &DragData) -> DropEffect
Whether this target accepts data, and if so which effect it would
apply. Returns DropEffect::None to reject.
Sourcefn accept_drop(
&mut self,
data: &DragData,
effect: DropEffect,
) -> Result<bool, UiError>
fn accept_drop( &mut self, data: &DragData, effect: DropEffect, ) -> Result<bool, UiError>
Commit a drop of data with the negotiated effect. Returns whether the
drop was consumed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".