pub struct ImportAssets { /* private fields */ }
Expand description
A struct to find imports in the project, given a certain name (or its part) and the context.
Implementations§
source§impl ImportAssets
impl ImportAssets
pub fn for_method_call( method_call: &MethodCallExpr, sema: &Semantics<'_, RootDatabase>, ) -> Option<Self>
pub fn for_exact_path( fully_qualified_path: &Path, sema: &Semantics<'_, RootDatabase>, ) -> Option<Self>
pub fn for_ident_pat( sema: &Semantics<'_, RootDatabase>, pat: &IdentPat, ) -> Option<Self>
pub fn for_fuzzy_path( module_with_candidate: Module, qualifier: Option<Path>, fuzzy_name: String, sema: &Semantics<'_, RootDatabase>, candidate_node: SyntaxNode, ) -> Option<Self>
pub fn for_fuzzy_method_call( module_with_method_call: Module, receiver_ty: Type, fuzzy_method_name: String, candidate_node: SyntaxNode, ) -> Option<Self>
source§impl ImportAssets
impl ImportAssets
pub fn import_candidate(&self) -> &ImportCandidate
pub fn search_for_imports( &self, sema: &Semantics<'_, RootDatabase>, cfg: ImportPathConfig, prefix_kind: PrefixKind, ) -> impl Iterator<Item = LocatedImport>
sourcepub fn search_for_relative_paths(
&self,
sema: &Semantics<'_, RootDatabase>,
cfg: ImportPathConfig,
) -> impl Iterator<Item = LocatedImport>
pub fn search_for_relative_paths( &self, sema: &Semantics<'_, RootDatabase>, cfg: ImportPathConfig, ) -> impl Iterator<Item = LocatedImport>
This may return non-absolute paths if a part of the returned path is already imported into scope.
sourcepub fn path_fuzzy_name_to_prefix(&mut self)
pub fn path_fuzzy_name_to_prefix(&mut self)
Requires imports to by prefix instead of fuzzily.
sourcepub fn path_fuzzy_name_to_exact(&mut self)
pub fn path_fuzzy_name_to_exact(&mut self)
Requires imports to match exactly instead of fuzzily.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImportAssets
impl !RefUnwindSafe for ImportAssets
impl !Send for ImportAssets
impl !Sync for ImportAssets
impl Unpin for ImportAssets
impl !UnwindSafe for ImportAssets
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<T> Cast for T
impl<T> Cast for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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