Skip to main content

DropTarget

Trait DropTarget 

Source
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§

Source

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.

Source

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".

Implementors§