pub struct SuccessRecord {
pub total_attempts: u64,
pub successes: u64,
pub failures: u64,
pub streak: i32,
pub best_streak: u32,
pub recent_results: Vec<bool>,
}Expand description
Success record with history.
Fields§
§total_attempts: u64§successes: u64§failures: u64§streak: i32§best_streak: u32§recent_results: Vec<bool>Implementations§
Source§impl SuccessRecord
impl SuccessRecord
pub fn success_rate(&self) -> f64
pub fn recent_success_rate(&self, window: usize) -> f64
Trait Implementations§
Source§impl Clone for SuccessRecord
impl Clone for SuccessRecord
Source§fn clone(&self) -> SuccessRecord
fn clone(&self) -> SuccessRecord
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 SuccessRecord
impl Debug for SuccessRecord
Source§impl Default for SuccessRecord
impl Default for SuccessRecord
Source§fn default() -> SuccessRecord
fn default() -> SuccessRecord
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SuccessRecord
impl RefUnwindSafe for SuccessRecord
impl Send for SuccessRecord
impl Sync for SuccessRecord
impl Unpin for SuccessRecord
impl UnsafeUnpin for SuccessRecord
impl UnwindSafe for SuccessRecord
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