pub struct ModuleState {
pub main_module_path: PathBuf,
pub node_module_import_paths: Vec<PathBuf>,
pub node_module_paths: Vec<PathBuf>,
pub package_jsons: HashMap<PathBuf, PackageJson>,
pub component_modules: HashMap<String, HashMap<u64, PathBuf>>,
pub contexts: HashMap<String, Value>,
pub import_paths: HashMap<String, PathBuf>,
}Expand description
Represents the fully-resolved state of all discoverable CJS modules.
Mirrors the TypeScript IModuleState.
Fields§
§main_module_path: PathBufPath to the root project.
node_module_import_paths: Vec<PathBuf>All ancestor paths used for node_modules searching.
node_module_paths: Vec<PathBuf>All discovered node module directories.
package_jsons: HashMap<PathBuf, PackageJson>Parsed package.json by module path.
component_modules: HashMap<String, HashMap<u64, PathBuf>>Component modules: module IRI → (major version → absolute components.jsonld path).
contexts: HashMap<String, Value>Contexts: context IRI → parsed JSON content of context file.
import_paths: HashMap<String, PathBuf>Import paths: IRI prefix → absolute local directory path.
Implementations§
Trait Implementations§
Source§impl Clone for ModuleState
impl Clone for ModuleState
Source§fn clone(&self) -> ModuleState
fn clone(&self) -> ModuleState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ModuleState
impl RefUnwindSafe for ModuleState
impl Send for ModuleState
impl Sync for ModuleState
impl Unpin for ModuleState
impl UnsafeUnpin for ModuleState
impl UnwindSafe for ModuleState
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