pub enum ImportKind {
Normal,
Wildcard,
Relative,
External,
Inherits,
Includes,
}Expand description
Classification of an import statement that determines how the resolver handles it.
An import can only have one kind. Priority when multiple could apply:
External > Relative > Wildcard > Normal. External imports are
never resolved; relative imports use the importing file’s directory as
base; wildcards may match multiple targets in future phases.
Variants§
Normal
Standard import (e.g. use foo::bar;, import X, #include "foo.h").
The resolver will attempt to resolve this against the file index.
Wildcard
Wildcard / glob import (e.g. use foo::*;, from x import *, import com.acme.*).
The resolver will attempt resolution but may match multiple targets.
Relative
Relative import that resolves from the importing file’s directory.
Used by Python (.x, ..x), Ruby (require_relative), C (#include "..."),
and TS/JS (./foo, ../bar).
External
External / third-party import that should be skipped by the resolver. (e.g. Rust non-crate imports, TS/JS bare specifiers, C angle-bracket system headers)
Inherits
Class inheritance: class Foo < Bar produces an Inherits import for Bar.
Used by Ruby/Rails for autoload-implicit dependencies resolved via Zeitwerk
path conventions.
Includes
Module inclusion: include Foo, extend Foo, prepend Foo all produce
an Includes import. Used by Ruby/Rails for concerns and shared modules,
resolved via Zeitwerk path conventions.
Trait Implementations§
Source§impl Clone for ImportKind
impl Clone for ImportKind
Source§fn clone(&self) -> ImportKind
fn clone(&self) -> ImportKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ImportKind
Source§impl Debug for ImportKind
impl Debug for ImportKind
Source§impl<'de> Deserialize<'de> for ImportKind
impl<'de> Deserialize<'de> for ImportKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ImportKind
Source§impl Hash for ImportKind
impl Hash for ImportKind
Source§impl PartialEq for ImportKind
impl PartialEq for ImportKind
Source§fn eq(&self, other: &ImportKind) -> bool
fn eq(&self, other: &ImportKind) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ImportKind
impl Serialize for ImportKind
impl StructuralPartialEq for ImportKind
Auto Trait Implementations§
impl Freeze for ImportKind
impl RefUnwindSafe for ImportKind
impl Send for ImportKind
impl Sync for ImportKind
impl Unpin for ImportKind
impl UnsafeUnpin for ImportKind
impl UnwindSafe for ImportKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> Fruit for T
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>
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>
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