pub struct SymbolResolver { /* private fields */ }Expand description
Symbol resolver for import-to-chunk mapping
Implementations§
Source§impl SymbolResolver
impl SymbolResolver
Sourcepub fn new(
project_root: impl Into<PathBuf>,
language: impl Into<String>,
) -> Self
pub fn new( project_root: impl Into<PathBuf>, language: impl Into<String>, ) -> Self
Create a new resolver for a project
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the resolution cache
Sourcepub fn extract_imports(&self, source: &str) -> Vec<RawImport>
pub fn extract_imports(&self, source: &str) -> Vec<RawImport>
Extract raw imports from source code
Sourcepub fn resolve_imports(
&mut self,
current_file: &Path,
imports: Vec<RawImport>,
graph: &GraphStore,
) -> CadiResult<Vec<ResolvedImport>>
pub fn resolve_imports( &mut self, current_file: &Path, imports: Vec<RawImport>, graph: &GraphStore, ) -> CadiResult<Vec<ResolvedImport>>
Resolve imports using a graph store
Sourcepub fn create_link_references(
&self,
imports: &[ResolvedImport],
) -> HashMap<String, String>
pub fn create_link_references( &self, imports: &[ResolvedImport], ) -> HashMap<String, String>
Create link references for use in atomized code
Transforms import { X } from './y' into link:sha256:abc123
Auto Trait Implementations§
impl Freeze for SymbolResolver
impl RefUnwindSafe for SymbolResolver
impl Send for SymbolResolver
impl Sync for SymbolResolver
impl Unpin for SymbolResolver
impl UnwindSafe for SymbolResolver
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