pub struct DragToOptions {
pub force: Option<bool>,
pub no_wait_after: Option<bool>,
pub timeout: Option<f64>,
pub trial: Option<bool>,
pub source_position: Option<Position>,
pub target_position: Option<Position>,
}Expand description
Options for [Locator::drag_to()].
Configuration for dragging a source element onto a target element.
Use the builder pattern to construct options:
§Example
ⓘ
use playwright_rs::{DragToOptions, Position};
// Drag with custom source and target positions
let options = DragToOptions::builder()
.source_position(Position { x: 10.0, y: 10.0 })
.target_position(Position { x: 60.0, y: 60.0 })
.build();
// Force drag (bypass actionability checks)
let options = DragToOptions::builder()
.force(true)
.build();
// Trial run (actionability checks only, don't actually drag)
let options = DragToOptions::builder()
.trial(true)
.build();See: https://playwright.dev/docs/api/class-locator#locator-drag-to
Fields§
§force: Option<bool>Whether to bypass actionability checks
no_wait_after: Option<bool>Don’t wait for navigation after the action
timeout: Option<f64>Maximum time in milliseconds
trial: Option<bool>Perform actionability checks without dragging
source_position: Option<Position>Where to click on the source element (relative to top-left corner)
target_position: Option<Position>Where to drop on the target element (relative to top-left corner)
Implementations§
Source§impl DragToOptions
impl DragToOptions
Sourcepub fn builder() -> DragToOptionsBuilder
pub fn builder() -> DragToOptionsBuilder
Create a new builder for DragToOptions
Trait Implementations§
Source§impl Clone for DragToOptions
impl Clone for DragToOptions
Source§fn clone(&self) -> DragToOptions
fn clone(&self) -> DragToOptions
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 moreSource§impl Debug for DragToOptions
impl Debug for DragToOptions
Source§impl Default for DragToOptions
impl Default for DragToOptions
Source§fn default() -> DragToOptions
fn default() -> DragToOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DragToOptions
impl RefUnwindSafe for DragToOptions
impl Send for DragToOptions
impl Sync for DragToOptions
impl Unpin for DragToOptions
impl UnsafeUnpin for DragToOptions
impl UnwindSafe for DragToOptions
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