pub struct FixTemplate {
pub name: String,
pub description: String,
pub template: String,
pub applicable_categories: Vec<ErrorCategory>,
pub target_error_codes: Vec<String>,
}
Expand description
Template for generating code fixes
Fields§
§name: String
Name of the template
description: String
Description of what the template does
template: String
The template code with placeholders
applicable_categories: Vec<ErrorCategory>
The error categories this template applies to
target_error_codes: Vec<String>
The error codes this template targets
Implementations§
Source§impl FixTemplate
impl FixTemplate
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
template: impl Into<String>,
) -> FixTemplate
pub fn new( name: impl Into<String>, description: impl Into<String>, template: impl Into<String>, ) -> FixTemplate
Creates a new FixTemplate
§Parameters
name
- Name of the templatedescription
- Description of what the template doestemplate
- The template code with placeholders
Sourcepub fn add_category(self, category: ErrorCategory) -> FixTemplate
pub fn add_category(self, category: ErrorCategory) -> FixTemplate
Sourcepub fn add_error_code(self, code: impl Into<String>) -> FixTemplate
pub fn add_error_code(self, code: impl Into<String>) -> FixTemplate
Trait Implementations§
Source§impl Clone for FixTemplate
impl Clone for FixTemplate
Source§fn clone(&self) -> FixTemplate
fn clone(&self) -> FixTemplate
Returns a copy 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