pub struct DndContext<T: DndItem> {
pub render: Callback<T, Element>,
pub placeholder_render: Option<Callback<(f64, f64), Element>>,
pub active: Signal<Option<T>>,
pub active_rect: Signal<Option<PixelsRect>>,
pub active_mounted: Signal<Option<Rc<MountedData>>>,
pub is_floating_ready: Signal<bool>,
pub mouse_pos: Signal<ClientPoint>,
pub start_pos: Signal<ClientPoint>,
pub grab_offset: Signal<OffsetOptions>,
pub key_gen: Callback<T, String>,
pub recalculate_rects: Signal<u64>,
}Expand description
State management for a Drag-and-Drop session.
Fields§
§render: Callback<T, Element>How to render the item in the list and overlay.
placeholder_render: Option<Callback<(f64, f64), Element>>Optional placeholder renderer used when an item is lifted.
active: Signal<Option<T>>Current active (dragged) item data.
active_rect: Signal<Option<PixelsRect>>Rect of the active item before it was lifted.
active_mounted: Signal<Option<Rc<MountedData>>>Internal: Reference to the mounted data of the active element.
is_floating_ready: Signal<bool>Flag indicating that the floating overlay is ready for display.
mouse_pos: Signal<ClientPoint>Current mouse coordinates relative to the viewport.
start_pos: Signal<ClientPoint>Mouse coordinates at the start of the drag operation.
grab_offset: Signal<OffsetOptions>Distance between the grab point and the element’s top-left corner.
key_gen: Callback<T, String>Key generator for DOM stability.
recalculate_rects: Signal<u64>Global trigger to force recalculation of element rectangles.
Trait Implementations§
Source§impl<T: Clone + DndItem> Clone for DndContext<T>
impl<T: Clone + DndItem> Clone for DndContext<T>
Source§fn clone(&self) -> DndContext<T>
fn clone(&self) -> DndContext<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: PartialEq + DndItem> PartialEq for DndContext<T>
impl<T: PartialEq + DndItem> PartialEq for DndContext<T>
Source§fn eq(&self, other: &DndContext<T>) -> bool
fn eq(&self, other: &DndContext<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: Copy + DndItem> Copy for DndContext<T>
impl<T: DndItem> StructuralPartialEq for DndContext<T>
Auto Trait Implementations§
impl<T> Freeze for DndContext<T>
impl<T> !RefUnwindSafe for DndContext<T>
impl<T> !Send for DndContext<T>
impl<T> !Sync for DndContext<T>
impl<T> Unpin for DndContext<T>where
T: Unpin,
impl<T> UnsafeUnpin for DndContext<T>
impl<T> !UnwindSafe for DndContext<T>
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> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.