pub struct L0Snapshot {
pub pins: Vec<(String, String)>,
pub pick_counts: Vec<(String, String, u32)>,
pub layer_prefs: [f64; 6],
}Expand description
Persistent state of the L0 layer. Caller serializes / deserializes this
however it likes (TOML, MessagePack, sqlite, …) — the crate intentionally
has no serde dependency.
Fields§
§pins: Vec<(String, String)>(code, word) pairs the user has pinned (manually or via record_pick
reaching threshold).
pick_counts: Vec<(String, String, u32)>(code, word, count) — pending pick counts that haven’t yet reached
PROMOTE_THRESHOLD. Snapshot semantics are best-effort; a count of
threshold - 1 restored after restart needs only one more pick to
promote.
layer_prefs: [f64; 6]Layer multipliers, indexed by Layer as usize.
Trait Implementations§
Source§impl Clone for L0Snapshot
impl Clone for L0Snapshot
Source§fn clone(&self) -> L0Snapshot
fn clone(&self) -> L0Snapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for L0Snapshot
impl RefUnwindSafe for L0Snapshot
impl Send for L0Snapshot
impl Sync for L0Snapshot
impl Unpin for L0Snapshot
impl UnsafeUnpin for L0Snapshot
impl UnwindSafe for L0Snapshot
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