pub struct DropTarget {
pub widget_id: WidgetId,
pub accepted_types: Vec<DragDataType>,
pub accepted_effects: Vec<DropEffect>,
pub bounds: Rect,
pub enabled: bool,
}Expand description
Configuration for a drop target.
Fields§
§widget_id: WidgetIdWidget ID of the drop target.
accepted_types: Vec<DragDataType>Accepted data types.
accepted_effects: Vec<DropEffect>Accepted drop effects.
bounds: RectBounds of the target.
enabled: boolWhether the target is currently active.
Implementations§
Source§impl DropTarget
impl DropTarget
Sourcepub fn new(widget_id: WidgetId, bounds: Rect) -> DropTarget
pub fn new(widget_id: WidgetId, bounds: Rect) -> DropTarget
Create a new drop target.
Sourcepub fn accept_types(self, types: Vec<DragDataType>) -> DropTarget
pub fn accept_types(self, types: Vec<DragDataType>) -> DropTarget
Accept specific data types.
Sourcepub fn accept_effects(self, effects: Vec<DropEffect>) -> DropTarget
pub fn accept_effects(self, effects: Vec<DropEffect>) -> DropTarget
Accept specific effects.
Sourcepub fn accepts(&self, data: &DragData, effect: DropEffect) -> bool
pub fn accepts(&self, data: &DragData, effect: DropEffect) -> bool
Check if this target accepts the given drag data.
Sourcepub fn contains_point(&self, point: Point) -> bool
pub fn contains_point(&self, point: Point) -> bool
Check if a point is within this target’s bounds.
Trait Implementations§
Source§impl Clone for DropTarget
impl Clone for DropTarget
Source§fn clone(&self) -> DropTarget
fn clone(&self) -> DropTarget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DropTarget
impl RefUnwindSafe for DropTarget
impl Send for DropTarget
impl Sync for DropTarget
impl Unpin for DropTarget
impl UnwindSafe for DropTarget
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