pub struct VariantScore {
pub index: usize,
pub source: String,
pub rendered: String,
pub score: f64,
pub salience: Salience,
pub is_last_selected: bool,
pub selected: bool,
}Expand description
Diagnostic output from Engine::score_variants: one entry per
variant that would be considered for the given key and context, with
the choose-best score the engine would assign and a flag marking the
variant that render() would currently emit.
Fields§
§index: usizeIndex within the salience-filtered alternative set.
source: StringOriginal template source string.
rendered: StringWhat the variant renders to with the given context.
score: f64Choose-best discourse score; combines repetition and cadence penalties. Lower is better.
salience: SalienceSalience bucket this variant was registered at.
is_last_selected: boolWhether this variant was the most recently selected for the same key (anti-repeat will try to avoid it on the next render).
selected: boolWhether render() would emit this variant right now.
Trait Implementations§
Source§impl Clone for VariantScore
impl Clone for VariantScore
Source§fn clone(&self) -> VariantScore
fn clone(&self) -> VariantScore
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 VariantScore
impl RefUnwindSafe for VariantScore
impl Send for VariantScore
impl Sync for VariantScore
impl Unpin for VariantScore
impl UnsafeUnpin for VariantScore
impl UnwindSafe for VariantScore
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