pub struct Assist {
pub id: AssistId,
pub label: Label,
pub group: Option<GroupLabel>,
pub target: TextRange,
pub source_change: Option<SourceChange>,
pub trigger_signature_help: bool,
}
Fields§
§id: AssistId
§label: Label
Short description of the assist, as shown in the UI.
group: Option<GroupLabel>
§target: TextRange
Target ranges are used to sort assists: the smaller the target range, the more specific assist is, and so it should be sorted first.
source_change: Option<SourceChange>
Computing source change sometimes is much more costly then computing the other fields. Additionally, the actual change is not required to show the lightbulb UI, it only is needed when the user tries to apply an assist. So, we compute it lazily: the API allow requesting assists with or without source change. We could (and in fact, used to) distinguish between resolved and unresolved assists at the type level, but this is cumbersome, especially if you want to embed an assist into another data structure, such as a diagnostic.
trigger_signature_help: bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Assist
impl RefUnwindSafe for Assist
impl Send for Assist
impl Sync for Assist
impl Unpin for Assist
impl UnwindSafe for Assist
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
source§impl<T> Cast for T
impl<T> Cast for T
source§fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
Cast a value to type
U
using CastTo
.