pub struct FixTemplate {
pub description_template: String,
pub fix_type: FixType,
pub base_confidence: f64,
pub command_templates: Vec<String>,
}Expand description
A template for generating fixes
Fields§
§description_template: StringTemplate for the description
fix_type: FixTypeFix type to use
base_confidence: f64Base confidence level
command_templates: Vec<String>Template for commands to apply
Implementations§
Source§impl FixTemplate
impl FixTemplate
Sourcepub fn new(
description_template: impl Into<String>,
fix_type: FixType,
base_confidence: f64,
) -> FixTemplate
pub fn new( description_template: impl Into<String>, fix_type: FixType, base_confidence: f64, ) -> FixTemplate
Creates a new FixTemplate
Sourcepub fn add_command_template(
&mut self,
template: impl Into<String>,
) -> &mut FixTemplate
pub fn add_command_template( &mut self, template: impl Into<String>, ) -> &mut FixTemplate
Adds a command template
Sourcepub fn apply(&self, params: &ExtractedParameters) -> Autocorrection
pub fn apply(&self, params: &ExtractedParameters) -> Autocorrection
Applies parameters to this template to create an Autocorrection
Trait Implementations§
Source§impl Clone for FixTemplate
impl Clone for FixTemplate
Source§fn clone(&self) -> FixTemplate
fn clone(&self) -> FixTemplate
Returns a duplicate of the value. Read more
1.0.0 · 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 FixTemplate
impl RefUnwindSafe for FixTemplate
impl Send for FixTemplate
impl Sync for FixTemplate
impl Unpin for FixTemplate
impl UnwindSafe for FixTemplate
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