pub struct ModuleState {
pub main_module_path: Url,
pub node_module_import_paths: Vec<Url>,
pub node_module_paths: Vec<Url>,
pub package_jsons: HashMap<Url, PackageJson>,
pub component_modules: HashMap<String, HashMap<u64, Url>>,
pub contexts: Arc<HashMap<String, JsonLdVal>>,
pub import_paths: HashMap<String, Url>,
pub context_urls: HashMap<String, Url>,
}Expand description
Represents the fully-resolved state of all discoverable CJS modules.
Mirrors the TypeScript IModuleState.
Fields§
§main_module_path: UrlURL of the root project directory.
node_module_import_paths: Vec<Url>All ancestor URLs used for node_modules searching.
node_module_paths: Vec<Url>All discovered node module directory URLs.
package_jsons: HashMap<Url, PackageJson>Parsed package.json by module directory URL.
component_modules: HashMap<String, HashMap<u64, Url>>Component modules: module IRI → (major version → absolute components.jsonld URL).
contexts: Arc<HashMap<String, JsonLdVal>>Contexts: context IRI → parsed content of context file. Wrapped in Arc so it can be shared cheaply across async tasks.
import_paths: HashMap<String, Url>Import paths: IRI prefix → absolute local directory URL.
context_urls: HashMap<String, Url>Context URLs: full context IRI → absolute local file URL (from lsd:contexts).
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