Skip to main content

Crate ty_module_resolver

Crate ty_module_resolver 

Source

Re-exports§

pub use resolve::file_to_module;

Structs§

FallibleStrategy
A MisconfigurationStrategy that happily fails whenever an important Err is encountered.
ModuleGlobSet
A compiled set of module glob patterns.
ModuleGlobSetBuilder
Builder for constructing a ModuleGlobSet.
ModuleName
A module name, e.g. foo.bar.
ResolverEnvironment
The Python version and search paths used to resolve modules.
ResolverFile
A file interpreted within a particular module-resolution environment.
SearchPath
Unification of the various kinds of search paths that can be used to locate Python modules.
SearchPathIterator
Iterate over the available module-resolution search paths, following the invariants maintained by sys.path at runtime: “No item is added to sys.path more than once.” Dynamic search paths (required for editable installs into site-packages) are only calculated lazily.
SearchPathSettings
Configures the search paths for module resolution.
SearchPaths
SystemModuleSearchPathsIter
TypeshedVersions
TypeshedVersionsParseError
UseDefaultStrategy
A MisconfigurationStrategy that refuses to ever return an Err and instead substitutes default values or skips functionality.

Enums§

ImportingFile
The file from which an import is resolved.
KnownModule
Enumeration of modules in which types with dedicated semantic behavior are located.
Module
Representation of a Python module.
ModuleGlobError
Error type for module glob pattern parsing.
ModuleNameMatch
The result of matching a module name against a ModuleGlobSet.
ModuleNameResolutionError
Various ways in which resolving a ModuleName from an ast::StmtImport or ast::StmtImportFrom node might fail
ModuleResolveMode
Selects typing or runtime module-resolution semantics.
PyVersionRange
SearchPathError
SearchPathSettingsError
Enumeration describing the various ways in which validation of the search paths options might fail.

Traits§

Db
MisconfigurationStrategy
Generic handling of two possible approaches to an Error:

Functions§

all_modules
List all available modules, including all sub-modules, sorted in lexicographic order.
file_to_module
Resolves the module for the file with the given id.
list_modules
List all available top-level modules.
resolve_module
Resolves a module name to a module.
resolve_module_confident
Resolves a module name to a module, without desperate resolution available.
resolve_module_for_import_from
Resolves the module referenced by a from import statement.
resolve_real_module
Resolves a module name to a module (stubs not allowed).
resolve_real_module_confident
Resolves a module name to a module, without desperate resolution available (stubs not allowed).
resolve_real_shadowable_module
Resolves a module name to a module (stubs not allowed, some shadowing is allowed).
search_paths
system_module_search_paths
Returns an iterator over all search paths pointing to a system path