pub struct NgramProposer {
pub accepts: u64,
pub rejects: u64,
/* private fields */
}Expand description
2026-09-25: The proposer. It keeps no index: propose searches the
history it is given.
Fields§
§accepts: u642026-09-25: Counts added to by record_accept and record_reject.
rejects: u64Implementations§
Source§impl NgramProposer
impl NgramProposer
pub fn new(_order: usize) -> Self
Sourcepub fn record_accept(&mut self)
pub fn record_accept(&mut self)
2026-09-25: Counts an accepted draft in accepts.
Sourcepub fn record_reject(&mut self)
pub fn record_reject(&mut self)
2026-09-25: Counts a rejected draft in rejects.
Sourcepub fn propose(&self, all_tokens: &[u32]) -> Option<u32>
pub fn propose(&self, all_tokens: &[u32]) -> Option<u32>
2026-09-25: For the longest suffix of all_tokens (from min_match
to max_match tokens) that also occurs earlier, returns the token after
its earliest occurrence; None when no suffix repeats.
Sourcepub fn observe(&mut self, _history: &[u32], _next: u32)
pub fn observe(&mut self, _history: &[u32], _next: u32)
2026-09-25: No-op: the proposer keeps no index.
pub fn len(&self) -> usize
Auto Trait Implementations§
impl Freeze for NgramProposer
impl RefUnwindSafe for NgramProposer
impl Send for NgramProposer
impl Sync for NgramProposer
impl Unpin for NgramProposer
impl UnwindSafe for NgramProposer
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