pub struct Stats { /* private fields */ }Implementations§
Source§impl Stats
impl Stats
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Opens the statistics database, creating it if it does not exist.
pub fn in_memory() -> Result<Self>
Sourcepub fn record_use(&self, id: &str, now: i64) -> Result<()>
pub fn record_use(&self, id: &str, now: i64) -> Result<()>
Records that an entry was selected, decaying its previous score first.
Sourcepub fn record_new(&self, id: &str, now: i64) -> Result<()>
pub fn record_new(&self, id: &str, now: i64) -> Result<()>
Gives a newly saved entry its head start.
Sourcepub fn scores(&self, now: i64) -> Result<HashMap<String, Score>>
pub fn scores(&self, now: i64) -> Result<HashMap<String, Score>>
Current scores for every entry that has one, decayed to now.
Entries absent from the result have never been used and rank below any entry that has.
pub fn set_pinned(&self, id: &str, pinned: bool, now: i64) -> Result<()>
Sourcepub fn remember_param(&self, id: &str, name: &str, value: &str) -> Result<()>
pub fn remember_param(&self, id: &str, name: &str, value: &str) -> Result<()>
Remembers the value last entered for a placeholder, so the next prompt arrives pre-filled.
pub fn last_params(&self, id: &str) -> Result<BTreeMap<String, String>>
Auto Trait Implementations§
impl !Freeze for Stats
impl !RefUnwindSafe for Stats
impl !Sync for Stats
impl !UnwindSafe for Stats
impl Send for Stats
impl Unpin for Stats
impl UnsafeUnpin for Stats
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