pub trait DragModifiers<V> {
// Required methods
fn on_drag<F>(self, action: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync;
fn on_drag_enter<F>(self, action: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync;
fn on_drag_leave<F>(self, action: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync;
fn on_drag_move<F>(self, action: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>, f32, f32) + Send + Sync;
fn on_drop<F>(self, action: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>, DropData) + Send + Sync;
fn on_drag_view<C, T>(self, content: C) -> Self
where C: Fn(&mut Context) -> Handle<'_, T> + 'static,
T: View;
}Expand description
Modifiers which add drag-and-drop callbacks to a view.
Required Methods§
Sourcefn on_drag<F>(self, action: F) -> Self
fn on_drag<F>(self, action: F) -> Self
Adds a callback which is performed when the view begins to be dragged.
The callback should call set_drop_data to supply the data
that will be delivered to the drop target.
Sourcefn on_drag_enter<F>(self, action: F) -> Self
fn on_drag_enter<F>(self, action: F) -> Self
Adds a callback which is performed when the cursor enters this view while carrying drag data.
Sourcefn on_drag_leave<F>(self, action: F) -> Self
fn on_drag_leave<F>(self, action: F) -> Self
Adds a callback which is performed when the cursor leaves this view while carrying drag data.
Sourcefn on_drag_move<F>(self, action: F) -> Self
fn on_drag_move<F>(self, action: F) -> Self
Adds a callback which is performed when the cursor moves over this view while carrying drag data.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.