#[non_exhaustive]pub struct Suggestion {
pub message: String,
pub edits: Vec<Replacement>,
pub applicability: Applicability,
}Expand description
A suggested fix: a message and a set of non-overlapping source edits, applied together. Maps directly onto an LSP code action or a rustc-style suggestion.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.message: StringWhat the fix does, e.g. “quote the value”.
edits: Vec<Replacement>The edits, sorted by position and non-overlapping.
applicability: ApplicabilityWhether the fix may be applied without review.
Implementations§
Source§impl Suggestion
impl Suggestion
Sourcepub fn new(
message: impl Into<String>,
edits: Vec<Replacement>,
applicability: Applicability,
) -> Self
pub fn new( message: impl Into<String>, edits: Vec<Replacement>, applicability: Applicability, ) -> Self
Creates a suggestion.
Trait Implementations§
Source§impl Clone for Suggestion
impl Clone for Suggestion
Source§impl Debug for Suggestion
impl Debug for Suggestion
impl Eq for Suggestion
Source§impl Hash for Suggestion
impl Hash for Suggestion
Source§impl PartialEq for Suggestion
impl PartialEq for Suggestion
impl StructuralPartialEq for Suggestion
Auto Trait Implementations§
impl Freeze for Suggestion
impl RefUnwindSafe for Suggestion
impl Send for Suggestion
impl Sync for Suggestion
impl Unpin for Suggestion
impl UnsafeUnpin for Suggestion
impl UnwindSafe for Suggestion
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