pub struct DropTargetInfo {
pub id: WidgetId,
pub name: String,
pub bounds: Rect,
pub accepted_types: Vec<String>,
pub enabled: bool,
}Expand description
Information about a potential drop target for keyboard navigation.
Fields§
§id: WidgetIdUnique identifier for the target widget.
name: StringHuman-readable name for accessibility.
bounds: RectBounding rectangle in screen coordinates.
accepted_types: Vec<String>Accepted drag types (MIME-like patterns).
enabled: boolWhether this target is currently enabled.
Implementations§
Source§impl DropTargetInfo
impl DropTargetInfo
Sourcepub fn new(id: WidgetId, name: impl Into<String>, bounds: Rect) -> Self
pub fn new(id: WidgetId, name: impl Into<String>, bounds: Rect) -> Self
Create a new drop target info.
Sourcepub fn with_accepted_types(self, types: Vec<String>) -> Self
pub fn with_accepted_types(self, types: Vec<String>) -> Self
Add accepted drag types.
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Set enabled state.
Sourcepub fn can_accept(&self, drag_type: &str) -> bool
pub fn can_accept(&self, drag_type: &str) -> bool
Check if this target can accept the given payload type.
Trait Implementations§
Source§impl Clone for DropTargetInfo
impl Clone for DropTargetInfo
Source§fn clone(&self) -> DropTargetInfo
fn clone(&self) -> DropTargetInfo
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 DropTargetInfo
impl RefUnwindSafe for DropTargetInfo
impl Send for DropTargetInfo
impl Sync for DropTargetInfo
impl Unpin for DropTargetInfo
impl UnsafeUnpin for DropTargetInfo
impl UnwindSafe for DropTargetInfo
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