pub enum ImportKind {
Static,
TypeOnly,
SideEffect,
Dynamic,
Require,
ImportMetaGlob,
SourceGlob,
ExportFrom,
Mock,
Url,
}Expand description
How a module is pulled in.
Variants§
Static
import a from "x" (not type-only, has bindings).
TypeOnly
import type … from "x": the whole declaration is type-only.
SideEffect
import "x".
Dynamic
import("x") with a literal specifier.
Require
require("x"), require.resolve("x"), import.meta.resolve("x") and import x = require("x").
ImportMetaGlob
One pattern of import.meta.glob(...), or the glob of a computed relative require or import()
(./commands/${name}): a glob, not a module specifier.
SourceGlob
One pattern of an import.meta.glob(...) whose options read the matched files as text (query: '?raw',
legacy as: 'raw'): the files are not loaded as modules, so the glob keeps none of them in use.
ExportFrom
export … from "x"; the matching Export is recorded too.
Mock
vi.mock("x"), jest.mock("x") and the other test-runner calls that name a module: the test loads or
replaces the module, which keeps a local file reachable but is not an import of a dependency.
Url
new URL("./x", import.meta.url), which the parser does not report: the file is loaded as a program of its own
(a worker, an asset), so every export of it counts as used, as for an entry.
Trait Implementations§
Source§impl Clone for ImportKind
impl Clone for ImportKind
impl 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§impl Serialize for ImportKind
impl Serialize for ImportKind
impl StructuralPartialEq for ImportKind
Auto Trait Implementations§
impl Forget for ImportKind
impl Freeze for ImportKind
impl Move 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<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> ErasedDestructor for Twhere
T: 'static,
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