pub struct HumanTyper { /* private fields */ }Expand description
A human-like typing simulator.
Implementations§
Source§impl HumanTyper
impl HumanTyper
Sourcepub fn with_config(config: HumanTypingConfig) -> Self
pub fn with_config(config: HumanTypingConfig) -> Self
Create a new human typer with custom configuration.
Sourcepub const fn config(&self) -> &HumanTypingConfig
pub const fn config(&self) -> &HumanTypingConfig
Get the configuration.
Sourcepub const fn set_config(&mut self, config: HumanTypingConfig)
pub const fn set_config(&mut self, config: HumanTypingConfig)
Set the configuration.
Sourcepub fn next_delay(&mut self) -> Duration
pub fn next_delay(&mut self) -> Duration
Generate a random delay between key presses.
Sourcepub fn should_make_typo(&mut self) -> bool
pub fn should_make_typo(&mut self) -> bool
Check if a typo should be made based on configuration.
Sourcepub fn make_typo(&mut self, c: char) -> (char, bool)
pub fn make_typo(&mut self, c: char) -> (char, bool)
Generate a typo for a character.
Returns the typo character and whether a correction should follow.
Sourcepub fn thinking_pause(&mut self) -> Duration
pub fn thinking_pause(&mut self) -> Duration
Generate pause duration for thinking.
Sourcepub fn plan_typing(&mut self, text: &str) -> Vec<TypeEvent>
pub fn plan_typing(&mut self, text: &str) -> Vec<TypeEvent>
Plan the keystrokes for a string, including delays and potential typos.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HumanTyper
impl !RefUnwindSafe for HumanTyper
impl !Send for HumanTyper
impl !Sync for HumanTyper
impl Unpin for HumanTyper
impl !UnwindSafe for HumanTyper
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