Struct nyar_error::FileCache
source · pub struct FileCache { /* private fields */ }Expand description
A [Cache] that fetches Sources from the filesystem.
Implementations§
source§impl FileCache
impl FileCache
sourcepub fn load_local<P>(&mut self, path: P) -> Result<FileID, Error>where
P: AsRef<Path>,
pub fn load_local<P>(&mut self, path: P) -> Result<FileID, Error>where P: AsRef<Path>,
Create a new FileCache.
sourcepub fn load_text<T, N>(&mut self, text: T, name: N) -> FileIDwhere
T: ToString,
N: ToString,
pub fn load_text<T, N>(&mut self, text: T, name: N) -> FileIDwhere T: ToString, N: ToString,
Create a new FileCache.
sourcepub unsafe fn set_source(&mut self, file: FileID, source: String) -> bool
pub unsafe fn set_source(&mut self, file: FileID, source: String) -> bool
Set the file source buy not update the context
sourcepub fn source_path(&self, file: &FileID) -> Option<&SourcePath>
pub fn source_path(&self, file: &FileID) -> Option<&SourcePath>
Create a new FileCache.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for FileCache
impl Send for FileCache
impl Sync for FileCache
impl Unpin for FileCache
impl UnwindSafe for FileCache
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