pub struct ImportEdit {
pub import_path: ModPath,
pub import_scope: ImportScope,
pub import_for_trait_assoc_item: bool,
}
Expand description
An extra import to add after the completion is applied.
Fields§
§import_path: ModPath
§import_scope: ImportScope
§import_for_trait_assoc_item: bool
Implementations§
Source§impl ImportEdit
impl ImportEdit
Sourcepub fn to_text_edit(
&self,
merge_behavior: Option<MergeBehavior>,
) -> Option<TextEdit>
pub fn to_text_edit( &self, merge_behavior: Option<MergeBehavior>, ) -> Option<TextEdit>
Attempts to insert the import to the given scope, producing a text edit. May return no edit in edge cases, such as scope already containing the import.
Trait Implementations§
Source§impl Clone for ImportEdit
impl Clone for ImportEdit
Source§fn clone(&self) -> ImportEdit
fn clone(&self) -> ImportEdit
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 ImportEdit
impl !RefUnwindSafe for ImportEdit
impl !Send for ImportEdit
impl !Sync for ImportEdit
impl Unpin for ImportEdit
impl !UnwindSafe for ImportEdit
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
.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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