pub enum ModuleResolveMode {
Typing,
Runtime,
RuntimeSomeShadowingAllowed,
}Expand description
Selects typing or runtime module-resolution semantics.
Variants§
Typing
Resolve modules for type checking, preferring stubs over runtime implementations.
This is the “normal” mode almost everything uses, as type checkers are in fact supposed to prefer stubs over the actual implementations.
Runtime
Resolve modules to their runtime implementations without considering stubs.
This is the “goto definition” mode, where we need to ignore the typing spec and find actual implementations. When querying searchpaths this also notably replaces typeshed with the “real” stdlib.
RuntimeSomeShadowingAllowed
Like ModuleResolveMode::Runtime, but permits some modules to be shadowed.
In particular, this allows typing_extensions to be shadowed by a
non-standard library module. This is useful in the context of the LSP
where we don’t want to pretend as if these modules are always available
at runtime.
Trait Implementations§
Source§impl Clone for ModuleResolveMode
impl Clone for ModuleResolveMode
Source§fn clone(&self) -> ModuleResolveMode
fn clone(&self) -> ModuleResolveMode
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 ModuleResolveMode
Source§impl Debug for ModuleResolveMode
impl Debug for ModuleResolveMode
impl Eq for ModuleResolveMode
Source§impl GetSize for ModuleResolveMode
impl GetSize for ModuleResolveMode
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Source§fn get_heap_size_with_tracker<TRACKER: GetSizeTracker>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)
fn get_heap_size_with_tracker<TRACKER: GetSizeTracker>( &self, tracker: TRACKER, ) -> (usize, TRACKER)
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
tracker. Read moreSource§impl Hash for ModuleResolveMode
impl Hash for ModuleResolveMode
Source§impl Ord for ModuleResolveMode
impl Ord for ModuleResolveMode
Source§fn cmp(&self, other: &ModuleResolveMode) -> Ordering
fn cmp(&self, other: &ModuleResolveMode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ModuleResolveMode
impl PartialEq for ModuleResolveMode
Source§impl PartialOrd for ModuleResolveMode
impl PartialOrd for ModuleResolveMode
impl StructuralPartialEq for ModuleResolveMode
Auto Trait Implementations§
impl Freeze for ModuleResolveMode
impl RefUnwindSafe for ModuleResolveMode
impl Send for ModuleResolveMode
impl Sync for ModuleResolveMode
impl Unpin for ModuleResolveMode
impl UnsafeUnpin for ModuleResolveMode
impl UnwindSafe for ModuleResolveMode
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> HashEqLike<&T> for T
impl<T> HashEqLike<&T> for T
Source§impl<T> HashEqLike<Cow<'_, T>> for T
impl<T> HashEqLike<Cow<'_, T>> for T
Source§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> 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