pub struct AcceptRule {
pub similarity_floor: f32,
pub min_run: u16,
pub max_rows: u16,
}Expand description
Three scalars that decide how many leading drafted rows are accepted; copyable so it can ride in a config.
Fields§
§similarity_floor: f32A drafted row counts as accepted when its similarity to the verifier’s row is at least this; 1.0 admits only rows the caller’s similarity scores 1.0.
min_run: u16A leading accepted run shorter than this is discarded, so the count is 0; 3 for a rule that only commits runs of three.
max_rows: u16The leading run is cut at this many rows; 8.
Implementations§
Source§impl AcceptRule
impl AcceptRule
Sourcepub fn accepted_rows<Entry>(
&self,
draft: &[Entry],
choices: &[Entry],
similarity: impl Fn(&Entry, &Entry) -> f32,
) -> usize
pub fn accepted_rows<Entry>( &self, draft: &[Entry], choices: &[Entry], similarity: impl Fn(&Entry, &Entry) -> f32, ) -> usize
Count of leading rows accepted; the caller is crate::serving_state::ServingState::accept_rows. The similarity is an argument because the entry type is generic, so only the caller can score two entries.
Trait Implementations§
Source§impl Clone for AcceptRule
impl Clone for AcceptRule
impl Copy for AcceptRule
Source§impl Debug for AcceptRule
impl Debug for AcceptRule
Source§impl Default for AcceptRule
impl Default for AcceptRule
Source§impl PartialEq for AcceptRule
impl PartialEq for AcceptRule
impl StructuralPartialEq for AcceptRule
Auto Trait Implementations§
impl Freeze for AcceptRule
impl RefUnwindSafe for AcceptRule
impl Send for AcceptRule
impl Sync for AcceptRule
impl Unpin for AcceptRule
impl UnsafeUnpin for AcceptRule
impl UnwindSafe for AcceptRule
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