Struct racer::core::FileCache [] [src]

pub struct FileCache<'c> {
    // some fields omitted
}

Methods

impl<'c> FileCache<'c>

fn new<'a>() -> FileCache<'a>

unsafe fn update_available_allocations(&self)

Updates available allocations from recently freed lists

While a session is active, allocations may be marked as freed. Reusing the allocation while references could still be active would have unintended consequences.

Safety

The FileCache must not have references handed out at the time this is called. Since the FileCache is only accessed by the Session, it is save to call this when the Session is dropped. Actually, it is called by the Session drop impl, and it shouldn't need to be called at any other time.

fn cache_file_contents<T>(&'c self, filepath: &Path, buf: T) where T: Into<String>

Cache the contents of buf using the given Path for a key.

Subsequent calls to load_file will return an IndexedSource of the provided buf.

fn open_file(&self, path: &Path) -> Result<File>

fn read_file(&self, path: &Path) -> Vec<u8>

fn load_file(&'c self, filepath: &Path) -> Src<'c>

fn load_file_and_mask_comments(&'c self, filepath: &Path) -> Src<'c>