pub struct Drill {
pub mode: Mode,
pub stage: usize,
pub text: Vec<char>,
pub pos: usize,
pub keys: u64,
pub misses: u64,
pub error: bool,
pub done: bool,
/* private fields */
}Fields§
§mode: Mode§stage: usize§text: Vec<char>§pos: usize§keys: u64§misses: u64§error: bool§done: boolImplementations§
Source§impl Drill
impl Drill
pub fn new(mode: Mode, stage: usize, text: String, now: Instant) -> Drill
pub fn expected(&self) -> Option<char>
pub fn started(&self) -> bool
Sourcepub fn press(&mut self, c: char, now: Instant)
pub fn press(&mut self, c: char, now: Instant)
Wrong keys don’t advance; they count as a miss on the key you wanted.
pub fn elapsed(&self, now: Instant) -> Duration
pub fn remaining(&self, now: Instant) -> Option<Duration>
pub fn wpm(&self, now: Instant) -> f64
pub fn accuracy(&self) -> f64
pub fn hesitating(&self, now: Instant) -> bool
pub fn letters(&self) -> &BTreeMap<String, LetterStat>
Sourcepub fn pairs(&self) -> &BTreeMap<String, LetterStat>
pub fn pairs(&self) -> &BTreeMap<String, LetterStat>
Timings for each pair of keys typed one after the other.
Auto Trait Implementations§
impl Forget for Drill
impl Freeze for Drill
impl Move for Drill
impl RefUnwindSafe for Drill
impl Send for Drill
impl Sync for Drill
impl Unpin for Drill
impl UnsafeUnpin for Drill
impl UnwindSafe for Drill
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> 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