pub struct Mouse { /* private fields */ }Expand description
Mouse provides low-level mouse control.
Coordinates are in main-frame CSS pixels relative to the viewport’s top-left corner.
Implementations§
Source§impl Mouse
impl Mouse
Sourcepub async fn move_to(
&self,
x: f64,
y: f64,
options: impl Into<Option<MouseOptions>>,
) -> Result<()>
pub async fn move_to( &self, x: f64, y: f64, options: impl Into<Option<MouseOptions>>, ) -> Result<()>
Dispatches a mousemove event.
§Note
Under headless Linux with the bundled Chromium, a move dispatched while a
button is held (between down and up) can
hang: the browser treats it as a native drag whose move never returns.
Use Locator::drag_to for
drag-and-drop; discrete down / up without an intervening move are
unaffected.
Sourcepub async fn click(
&self,
x: f64,
y: f64,
options: impl Into<Option<MouseOptions>>,
) -> Result<()>
pub async fn click( &self, x: f64, y: f64, options: impl Into<Option<MouseOptions>>, ) -> Result<()>
Combines move(), down(), and up() actions.
See: https://playwright.dev/docs/api/class-mouse#mouse-click
Sourcepub async fn dblclick(
&self,
x: f64,
y: f64,
options: impl Into<Option<MouseOptions>>,
) -> Result<()>
pub async fn dblclick( &self, x: f64, y: f64, options: impl Into<Option<MouseOptions>>, ) -> Result<()>
Shortcut performing move(), down(), up(), down(), and up() sequentially.
See: https://playwright.dev/docs/api/class-mouse#mouse-dblclick
Sourcepub async fn down(&self, options: impl Into<Option<MouseOptions>>) -> Result<()>
pub async fn down(&self, options: impl Into<Option<MouseOptions>>) -> Result<()>
Dispatches a mousedown event.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Mouse
impl !RefUnwindSafe for Mouse
impl !UnwindSafe for Mouse
impl Send for Mouse
impl Sync for Mouse
impl Unpin for Mouse
impl UnsafeUnpin for Mouse
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