pub struct BidiMouse<OT: ConnectionTransport> { /* private fields */ }Expand description
Direct BiDi mouse implementation with instant, precise movements.
BidiMouse provides direct control over mouse actions without any delays or smoothing.
Movements are instant and precise, making it ideal for automation scenarios where
speed is more important than mimicking human behavior.
For human-like movements with curves and realistic delays, use HumanMouse instead.
§Examples
let mouse = BidiMouse::new(session);
// Move instantly to coordinates
mouse.move_to(Point { x: 100.0, y: 200.0 }, &context, None).await?;
// Click at current position
mouse.click(None, &context, None).await?;Implementations§
Source§impl<OT: ConnectionTransport> BidiMouse<OT>
impl<OT: ConnectionTransport> BidiMouse<OT>
Sourcepub async fn reset(&self, context: &BrowsingContext) -> Result<(), InputError>
pub async fn reset(&self, context: &BrowsingContext) -> Result<(), InputError>
Reset the mouse state
Sourcepub async fn move_to(
&self,
point: Point,
context: &BrowsingContext,
options: Option<MouseMoveOptions>,
) -> Result<(), InputError>
pub async fn move_to( &self, point: Point, context: &BrowsingContext, options: Option<MouseMoveOptions>, ) -> Result<(), InputError>
Move the mouse to a position
Sourcepub async fn down(
&self,
context: &BrowsingContext,
options: Option<MouseOptions>,
) -> Result<(), InputError>
pub async fn down( &self, context: &BrowsingContext, options: Option<MouseOptions>, ) -> Result<(), InputError>
Press a mouse button down
Sourcepub async fn up(
&self,
context: &BrowsingContext,
options: Option<MouseOptions>,
) -> Result<(), InputError>
pub async fn up( &self, context: &BrowsingContext, options: Option<MouseOptions>, ) -> Result<(), InputError>
Release a mouse button
Sourcepub async fn click(
&self,
point: Option<Point>,
context: &BrowsingContext,
options: Option<MouseClickOptions>,
) -> Result<(), InputError>
pub async fn click( &self, point: Option<Point>, context: &BrowsingContext, options: Option<MouseClickOptions>, ) -> Result<(), InputError>
Click at a position
Sourcepub async fn wheel(
&self,
context: &BrowsingContext,
options: Option<MouseWheelOptions>,
) -> Result<(), InputError>
pub async fn wheel( &self, context: &BrowsingContext, options: Option<MouseWheelOptions>, ) -> Result<(), InputError>
Scroll the mouse wheel
Trait Implementations§
Source§impl<OT: ConnectionTransport> Mouse for BidiMouse<OT>
impl<OT: ConnectionTransport> Mouse for BidiMouse<OT>
Source§fn set_last_position(&self, point: Point)
fn set_last_position(&self, point: Point)
Set the last mouse position
Source§async fn reset(&self, context: &BrowsingContext) -> Result<(), InputError>
async fn reset(&self, context: &BrowsingContext) -> Result<(), InputError>
Reset the mouse state
Source§async fn move_to(
&self,
point: Point,
context: &BrowsingContext,
options: Option<MouseMoveOptions>,
) -> Result<(), InputError>
async fn move_to( &self, point: Point, context: &BrowsingContext, options: Option<MouseMoveOptions>, ) -> Result<(), InputError>
Move the mouse to a position
Source§async fn down(
&self,
context: &BrowsingContext,
options: Option<MouseOptions>,
) -> Result<(), InputError>
async fn down( &self, context: &BrowsingContext, options: Option<MouseOptions>, ) -> Result<(), InputError>
Press a mouse button down
Source§async fn up(
&self,
context: &BrowsingContext,
options: Option<MouseOptions>,
) -> Result<(), InputError>
async fn up( &self, context: &BrowsingContext, options: Option<MouseOptions>, ) -> Result<(), InputError>
Release a mouse button
Source§async fn click(
&self,
point: Option<Point>,
context: &BrowsingContext,
options: Option<MouseClickOptions>,
) -> Result<(), InputError>
async fn click( &self, point: Option<Point>, context: &BrowsingContext, options: Option<MouseClickOptions>, ) -> Result<(), InputError>
Click at a position (or last position if point is None)
Source§async fn wheel(
&self,
context: &BrowsingContext,
options: Option<MouseWheelOptions>,
) -> Result<(), InputError>
async fn wheel( &self, context: &BrowsingContext, options: Option<MouseWheelOptions>, ) -> Result<(), InputError>
Scroll the mouse wheel
Auto Trait Implementations§
impl<OT> Freeze for BidiMouse<OT>
impl<OT> !RefUnwindSafe for BidiMouse<OT>
impl<OT> Send for BidiMouse<OT>where
OT: Send,
impl<OT> Sync for BidiMouse<OT>where
OT: Send,
impl<OT> Unpin for BidiMouse<OT>
impl<OT> !UnwindSafe for BidiMouse<OT>
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> 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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more