Struct deno_graph::ModuleGraph [−][src]
pub struct ModuleGraph { pub root: ModuleSpecifier, // some fields omitted }
Fields
root: ModuleSpecifier
Implementations
Get a module from the module graph, returning None
if the module is not
part of the graph, or if when loading the module it errored. If any module
resolution error is needed, then use the try_get()
method which will
return any resolution error as the error in the result.
Determine if the graph sources are valid by calling the passed locker. If the integrity of all the sources passes or if there is no locker supplied the method results in an ok, otherwise returns an error which indicates the first specifier that failed the integrity check.
Resolve a specifier from the module graph following any possible redirects returning the “final” module.
pub fn resolve_dependency(
&self,
specifier: &str,
referrer: &ModuleSpecifier
) -> Option<&ModuleSpecifier>
pub fn resolve_dependency(
&self,
specifier: &str,
referrer: &ModuleSpecifier
) -> Option<&ModuleSpecifier>
Resolve a dependency of a referring module providing the string specifier of the depdency and returning an optional fully qualified module specifier.
pub fn try_get(
&self,
specifier: &ModuleSpecifier
) -> Result<Option<&Module>, ModuleGraphError>
pub fn try_get(
&self,
specifier: &ModuleSpecifier
) -> Result<Option<&Module>, ModuleGraphError>
Retrieve a module from the module graph. If the module identified as a
dependency of the graph, but resolving or loading that module resulted in
an error, the error will be returned as the Err
of the result. If the
module is not part of the graph, or the module is missing from the graph,
the result will be Ok
with the option of the module.