Struct deno_graph::CapturingModuleAnalyzer
source · pub struct CapturingModuleAnalyzer { /* private fields */ }
Expand description
Helper struct for creating a single object that implements
deno_graph::ModuleAnalyzer
, deno_graph::ModuleParser
,
and deno_graph::ParsedSourceStore
. All parses will be captured
to prevent them from occuring more than one time.
Implementations§
source§impl CapturingModuleAnalyzer
impl CapturingModuleAnalyzer
pub fn new( parser: Option<Box<dyn ModuleParser>>, store: Option<Box<dyn ParsedSourceStore>> ) -> Self
pub fn as_capturing_parser(&self) -> CapturingModuleParser<'_>
Trait Implementations§
source§impl Default for CapturingModuleAnalyzer
impl Default for CapturingModuleAnalyzer
source§impl ModuleAnalyzer for CapturingModuleAnalyzer
impl ModuleAnalyzer for CapturingModuleAnalyzer
source§fn analyze(
&self,
specifier: &ModuleSpecifier,
source: Arc<str>,
media_type: MediaType
) -> Result<ModuleInfo, Diagnostic>
fn analyze( &self, specifier: &ModuleSpecifier, source: Arc<str>, media_type: MediaType ) -> Result<ModuleInfo, Diagnostic>
Analyzes the module.
source§impl ModuleParser for CapturingModuleAnalyzer
impl ModuleParser for CapturingModuleAnalyzer
fn parse_module( &self, options: ParseOptions<'_> ) -> Result<ParsedSource, Diagnostic>
source§impl ParsedSourceStore for CapturingModuleAnalyzer
impl ParsedSourceStore for CapturingModuleAnalyzer
source§fn set_parsed_source(
&self,
specifier: ModuleSpecifier,
parsed_source: ParsedSource
) -> Option<ParsedSource>
fn set_parsed_source( &self, specifier: ModuleSpecifier, parsed_source: ParsedSource ) -> Option<ParsedSource>
Sets the parsed source, potentially returning the previous value.
fn get_parsed_source(&self, specifier: &ModuleSpecifier) -> Option<ParsedSource>
source§fn get_scope_analysis_parsed_source(
&self,
specifier: &ModuleSpecifier
) -> Option<ParsedSource>
fn get_scope_analysis_parsed_source( &self, specifier: &ModuleSpecifier ) -> Option<ParsedSource>
Gets a
deno_ast::ParsedSource
from the store, upgrading it
to have scope analysis if it doesn’t already.Auto Trait Implementations§
impl !RefUnwindSafe for CapturingModuleAnalyzer
impl !Send for CapturingModuleAnalyzer
impl !Sync for CapturingModuleAnalyzer
impl Unpin for CapturingModuleAnalyzer
impl !UnwindSafe for CapturingModuleAnalyzer
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