pub struct CjsModule {
pub iri: String,
pub require_name: Option<String>,
pub components: Vec<CjsComponent>,
pub source_file: String,
pub iri_span: Range<usize>,
}Expand description
A CJS module — the top-level container declared in a components.jsonld file.
Each npm package with lsd:module exposes exactly one module. The module
groups all its component classes and is the entry point for import-path
resolution. Use source_file + iri_span for goto-definition on module IRIs
that appear in config @context entries.
Fields§
§iri: StringFull expanded IRI of this module (e.g. https://…/MyPackage).
require_name: Option<String>npm package name used in require() calls (from doap:name).
components: Vec<CjsComponent>All component classes declared in this module.
source_file: StringAbsolute path to the components.jsonld file that defines this module.
iri_span: Range<usize>Byte range of the @id value for this module in source_file.
Use this for LSP goto-definition when the cursor is on a module IRI.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CjsModule
impl RefUnwindSafe for CjsModule
impl Send for CjsModule
impl Sync for CjsModule
impl Unpin for CjsModule
impl UnsafeUnpin for CjsModule
impl UnwindSafe for CjsModule
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