pub struct SuggestedFix {
pub replacement: String,
pub confidence: f32,
pub description: String,
pub start_offset: usize,
pub end_offset: usize,
pub error_code: String,
}Expand description
A suggested fix for a compiler error.
Fields§
§replacement: StringThe replacement text
confidence: f32Confidence score (0.0 to 1.0)
description: StringHuman-readable description
start_offset: usizeStart offset in source (byte position)
end_offset: usizeEnd offset in source (byte position)
error_code: StringError code this fix addresses
Implementations§
Source§impl SuggestedFix
impl SuggestedFix
Sourcepub fn new(
replacement: String,
confidence: f32,
description: String,
) -> SuggestedFix
pub fn new( replacement: String, confidence: f32, description: String, ) -> SuggestedFix
Create a new suggested fix.
Sourcepub fn with_span(self, start: usize, end: usize) -> SuggestedFix
pub fn with_span(self, start: usize, end: usize) -> SuggestedFix
Set the span for replacement.
Sourcepub fn with_error_code(self, code: &str) -> SuggestedFix
pub fn with_error_code(self, code: &str) -> SuggestedFix
Set the error code.
Trait Implementations§
Source§impl Clone for SuggestedFix
impl Clone for SuggestedFix
Source§fn clone(&self) -> SuggestedFix
fn clone(&self) -> SuggestedFix
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 SuggestedFix
impl RefUnwindSafe for SuggestedFix
impl Send for SuggestedFix
impl Sync for SuggestedFix
impl Unpin for SuggestedFix
impl UnsafeUnpin for SuggestedFix
impl UnwindSafe for SuggestedFix
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more