pub struct AstCache { /* private fields */ }Expand description
AST cache for parsed Rust files
Implementations§
Source§impl AstCache
impl AstCache
pub fn new() -> Self
Sourcepub fn parse_and_cache_all_files(
&mut self,
project_path: &str,
verbose: bool,
) -> Result<(), Box<dyn Error>>
pub fn parse_and_cache_all_files( &mut self, project_path: &str, verbose: bool, ) -> Result<(), Box<dyn Error>>
Parse and cache all Rust files in the given project path
Sourcepub fn get(&self, path: &PathBuf) -> Option<&ParsedFile>
pub fn get(&self, path: &PathBuf) -> Option<&ParsedFile>
Get a parsed file from the cache
Sourcepub fn get_cloned(&self, path: &PathBuf) -> Option<ParsedFile>
pub fn get_cloned(&self, path: &PathBuf) -> Option<ParsedFile>
Get a cloned parsed file from the cache
Sourcepub fn keys(&self) -> Keys<'_, PathBuf, ParsedFile>
pub fn keys(&self) -> Keys<'_, PathBuf, ParsedFile>
Get all cached file paths
Sourcepub fn iter(&self) -> Iter<'_, PathBuf, ParsedFile>
pub fn iter(&self) -> Iter<'_, PathBuf, ParsedFile>
Get all cached files as an iterator
Sourcepub fn insert(
&mut self,
path: PathBuf,
parsed_file: ParsedFile,
) -> Option<ParsedFile>
pub fn insert( &mut self, path: PathBuf, parsed_file: ParsedFile, ) -> Option<ParsedFile>
Insert a parsed file into the cache
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AstCache
impl RefUnwindSafe for AstCache
impl !Send for AstCache
impl !Sync for AstCache
impl Unpin for AstCache
impl UnwindSafe for AstCache
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