pub struct DragAndDropBuilder<'a> { /* private fields */ }Expand description
Builder for drag and drop operations.
Created via Page::drag_and_drop.
§Example
ⓘ
// Simple drag and drop
page.drag_and_drop("#source", "#target").send().await?;
// With position options
page.drag_and_drop("#source", "#target")
.source_position(10.0, 10.0)
.target_position(5.0, 5.0)
.send()
.await?;Implementations§
Source§impl<'a> DragAndDropBuilder<'a>
impl<'a> DragAndDropBuilder<'a>
Sourcepub fn source_position(self, x: f64, y: f64) -> Self
pub fn source_position(self, x: f64, y: f64) -> Self
Set the position within the source element to start dragging from.
Coordinates are relative to the element’s top-left corner.
Sourcepub fn target_position(self, x: f64, y: f64) -> Self
pub fn target_position(self, x: f64, y: f64) -> Self
Set the position within the target element to drop at.
Coordinates are relative to the element’s top-left corner.
Sourcepub fn steps(self, steps: u32) -> Self
pub fn steps(self, steps: u32) -> Self
Set the number of intermediate steps for smooth dragging.
Sourcepub async fn send(self) -> Result<(), LocatorError>
pub async fn send(self) -> Result<(), LocatorError>
Execute the drag and drop operation.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DragAndDropBuilder<'a>
impl<'a> !RefUnwindSafe for DragAndDropBuilder<'a>
impl<'a> Send for DragAndDropBuilder<'a>
impl<'a> Sync for DragAndDropBuilder<'a>
impl<'a> Unpin for DragAndDropBuilder<'a>
impl<'a> !UnwindSafe for DragAndDropBuilder<'a>
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