Trait deno_graph::ParsedSourceStore

source ·
pub trait ParsedSourceStore {
    // Required methods
    fn set_parsed_source(
        &self,
        specifier: ModuleSpecifier,
        parsed_source: ParsedSource
    ) -> Option<ParsedSource>;
    fn get_parsed_source(
        &self,
        specifier: &ModuleSpecifier
    ) -> Option<ParsedSource>;
    fn get_scope_analysis_parsed_source(
        &self,
        specifier: &ModuleSpecifier
    ) -> Option<ParsedSource>;

    // Provided method
    fn remove_parsed_source(
        &self,
        specifier: &ModuleSpecifier
    ) -> Option<ParsedSource> { ... }
}
Expand description

Stores parsed sources.

Note: This interface is racy and not thread safe, as it’s assumed it will only store the latest changes or that the source text will never change.

Required Methods§

source

fn set_parsed_source( &self, specifier: ModuleSpecifier, parsed_source: ParsedSource ) -> Option<ParsedSource>

Sets the parsed source, potentially returning the previous value.

source

fn get_parsed_source(&self, specifier: &ModuleSpecifier) -> Option<ParsedSource>

source

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.

Provided Methods§

Implementors§