#[non_exhaustive]pub struct ModuleMap {
pub sources: Vec<String>,
pub names: usize,
pub damaged: bool,
/* private fields */
}Expand description
The source map of one module: which source line each line of the compiled file comes from.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sources: Vec<String>The source files, as the build names them: from the project root
(entry/src/main/ets/pages/Index.ets,
oh_modules/.ohpm/lib@1.0.0/oh_modules/lib/index.ts).
names: usizeHow many identifier names the map carries (names): none in the
maps the build tools are known to write.
damaged: boolWhether mappings stopped at something that is not a mapping; the
lines before it stand.
Implementations§
Source§impl ModuleMap
impl ModuleMap
Sourcepub fn mapped_sources(&self) -> &[u32]
pub fn mapped_sources(&self) -> &[u32]
The source files some line of the compiled file comes from, by
index into ModuleMap::sources, ascending. A module bundled from
several files has more than one; sources may also list files no
line maps to.
Sourcepub fn source_line(&self, compiled: u32) -> Option<SourceLine>
pub fn source_line(&self, compiled: u32) -> Option<SourceLine>
The source line that line compiled of the compiled file (counted
from 0, as the debug info of the code counts) was made from; None
for a line the build added, and for one past the end of the map.
Sourcepub fn source_lines(&self) -> &[Option<SourceLine>]
pub fn source_lines(&self) -> &[Option<SourceLine>]
ModuleMap::source_line of every line of the compiled file.