pub struct Keyboard { /* private fields */ }Expand description
Keyboard input device.
Implementations§
Source§impl Keyboard
impl Keyboard
Sourcepub async fn press(
&self,
key: &str,
options: Option<PressOptions>,
) -> Result<()>
pub async fn press( &self, key: &str, options: Option<PressOptions>, ) -> Result<()>
Press key (down + up), optionally delaying between the two.
Sourcepub async fn insert_text(&self, text: &str) -> Result<()>
pub async fn insert_text(&self, text: &str) -> Result<()>
Insert text directly, replacing the selection (fast, no per-key delay).
Sourcepub async fn type_text(
&self,
text: &str,
options: Option<PressSequentiallyOptions>,
) -> Result<()>
pub async fn type_text( &self, text: &str, options: Option<PressSequentiallyOptions>, ) -> Result<()>
Type text. With no delay this uses Self::insert_text; with a delay
it types character-by-character (matching Playwright keyboard.type).
Sourcepub async fn type_(
&self,
text: &str,
options: Option<PressSequentiallyOptions>,
) -> Result<()>
pub async fn type_( &self, text: &str, options: Option<PressSequentiallyOptions>, ) -> Result<()>
Playwright-style alias for Self::type_text.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Keyboard
impl !UnwindSafe for Keyboard
impl Freeze for Keyboard
impl Send for Keyboard
impl Sync for Keyboard
impl Unpin for Keyboard
impl UnsafeUnpin for Keyboard
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