pub struct Autocorrection {
pub description: String,
pub fix_type: FixType,
pub confidence: f64,
pub details: Option<FixDetails>,
pub diff_suggestion: Option<String>,
pub commands_to_apply: Vec<String>,
pub targets_error_code: Option<String>,
}
Expand description
A proposed autocorrection for an error
Fields§
§description: String
Human-readable description of the autocorrection
fix_type: FixType
Type of fix being proposed
confidence: f64
Confidence level (0.0 to 1.0) in the correctness of this fix
details: Option<FixDetails>
Detailed information about the fix
diff_suggestion: Option<String>
Optional diff-style representation of the suggested change
commands_to_apply: Vec<String>
Shell commands that can be executed to apply the fix
targets_error_code: Option<String>
Error code that this autocorrection targets
Implementations§
Source§impl Autocorrection
impl Autocorrection
Sourcepub fn new(
description: impl Into<String>,
fix_type: FixType,
confidence: f64,
) -> Autocorrection
pub fn new( description: impl Into<String>, fix_type: FixType, confidence: f64, ) -> Autocorrection
Creates a new Autocorrection with the given description, fix type, and confidence level
§Parameters
description
- Human-readable description of the autocorrectionfix_type
- Type of fix being proposedconfidence
- Confidence level (0.0 to 1.0) in the correctness of this fix
Sourcepub fn with_details(self, details: FixDetails) -> Autocorrection
pub fn with_details(self, details: FixDetails) -> Autocorrection
Adds detailed information about the fix
§Parameters
details
- Detailed information about how to apply the fix
Sourcepub fn with_diff_suggestion(self, diff: impl Into<String>) -> Autocorrection
pub fn with_diff_suggestion(self, diff: impl Into<String>) -> Autocorrection
Adds a diff-style representation of the suggested change
§Parameters
diff
- Diff-style representation of the change
Sourcepub fn add_command(self, command: impl Into<String>) -> Autocorrection
pub fn add_command(self, command: impl Into<String>) -> Autocorrection
Adds a shell command that can be executed to apply the fix
§Parameters
command
- Shell command to execute
Sourcepub fn with_target_error_code(self, code: impl Into<String>) -> Autocorrection
pub fn with_target_error_code(self, code: impl Into<String>) -> Autocorrection
Trait Implementations§
Source§impl Clone for Autocorrection
impl Clone for Autocorrection
Source§fn clone(&self) -> Autocorrection
fn clone(&self) -> Autocorrection
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 Autocorrection
impl RefUnwindSafe for Autocorrection
impl Send for Autocorrection
impl Sync for Autocorrection
impl Unpin for Autocorrection
impl UnwindSafe for Autocorrection
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