pub struct Mouse { /* private fields */ }Expand description
Mouse input device. The last-known pointer position is shared across clones
created from the same page (mirroring Playwright’s persistent page.mouse()),
so down()/up() can fire at the position set by the most recent move_to().
Implementations§
Source§impl Mouse
impl Mouse
Sourcepub async fn move_to(
&self,
x: f64,
y: f64,
_options: Option<MouseOptions>,
) -> Result<()>
pub async fn move_to( &self, x: f64, y: f64, _options: Option<MouseOptions>, ) -> Result<()>
Move the pointer to (x, y).
Sourcepub async fn down(&self, options: Option<MouseOptions>) -> Result<()>
pub async fn down(&self, options: Option<MouseOptions>) -> Result<()>
Press the (currently positioned) button down.
Sourcepub async fn up(&self, options: Option<MouseOptions>) -> Result<()>
pub async fn up(&self, options: Option<MouseOptions>) -> Result<()>
Release the (currently positioned) button.
Sourcepub async fn click(
&self,
x: f64,
y: f64,
options: Option<MouseOptions>,
) -> Result<()>
pub async fn click( &self, x: f64, y: f64, options: Option<MouseOptions>, ) -> Result<()>
Move to (x, y) and click once (press + release).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Mouse
impl !UnwindSafe for Mouse
impl Freeze 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