pub struct HumanTypingConfig {
pub base_delay: Duration,
pub variance: Duration,
pub typo_chance: f32,
pub correction_chance: f32,
}Expand description
Configuration for human-like typing.
Fields§
§base_delay: DurationBase delay between characters.
variance: DurationVariance in delay (random offset from base).
typo_chance: f32Chance of making a typo (0.0 to 1.0).
correction_chance: f32Chance of correcting a typo (0.0 to 1.0).
Implementations§
Source§impl HumanTypingConfig
impl HumanTypingConfig
Sourcepub fn new(base_delay: Duration, variance: Duration) -> Self
pub fn new(base_delay: Duration, variance: Duration) -> Self
Create a new human typing configuration.
Sourcepub const fn typo_chance(self, chance: f32) -> Self
pub const fn typo_chance(self, chance: f32) -> Self
Set the typo chance.
Sourcepub const fn correction_chance(self, chance: f32) -> Self
pub const fn correction_chance(self, chance: f32) -> Self
Set the correction chance.
Trait Implementations§
Source§impl Clone for HumanTypingConfig
impl Clone for HumanTypingConfig
Source§fn clone(&self) -> HumanTypingConfig
fn clone(&self) -> HumanTypingConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HumanTypingConfig
impl Debug for HumanTypingConfig
Auto Trait Implementations§
impl Freeze for HumanTypingConfig
impl RefUnwindSafe for HumanTypingConfig
impl Send for HumanTypingConfig
impl Sync for HumanTypingConfig
impl Unpin for HumanTypingConfig
impl UnwindSafe for HumanTypingConfig
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