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 accept_types(self, types: Vec<DragDataType>) -> Self
pub fn accept_types(self, types: Vec<DragDataType>) -> Self
Accept specific data types.
Sourcepub fn accept_effects(self, effects: Vec<DropEffect>) -> Self
pub fn accept_effects(self, effects: Vec<DropEffect>) -> Self
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more