pub struct MapFileStore<T> { /* private fields */ }
Implementations§
Source§impl<T: PathMap> MapFileStore<T>
impl<T: PathMap> MapFileStore<T>
pub fn update_file(&mut self, id: SourceId, content: String)
Source§impl MapFileStore<WithPathMap>
impl MapFileStore<WithPathMap>
Sourcepub fn update_file_at_path(&mut self, path: &Path, content: String)
pub fn update_file_at_path(&mut self, path: &Path, content: String)
Updates an existing entry
TODO partial updates
Sourcepub fn get_source_at_path(&self, path: &Path) -> Option<SourceId>
pub fn get_source_at_path(&self, path: &Path) -> Option<SourceId>
Returns a possible SourceId for a path
Sourcepub fn change_file_path(&mut self, from: &Path, to: PathBuf)
pub fn change_file_path(&mut self, from: &Path, to: PathBuf)
Either a rename or move. Must already exist
pub fn create_or_update_file_at_path(&mut self, path: &Path, content: String)
pub fn get_paths(&self) -> &HashMap<PathBuf, SourceId>
Trait Implementations§
Source§impl<T: Default> Default for MapFileStore<T>
impl<T: Default> Default for MapFileStore<T>
Source§fn default() -> MapFileStore<T>
fn default() -> MapFileStore<T>
Returns the “default value” for a type. Read more
Source§impl<M: PathMap> FileSystem for MapFileStore<M>
impl<M: PathMap> FileSystem for MapFileStore<M>
fn new_source_id_with_line_starts( &mut self, path: PathBuf, content: String, ) -> (SourceId, LineStarts)
fn get_source_by_id<T, F: for<'a> FnOnce(&'a Source) -> T>( &self, source_id: SourceId, f: F, ) -> T
Source§fn new_source_id(&mut self, path: PathBuf, content: String) -> SourceId
fn new_source_id(&mut self, path: PathBuf, content: String) -> SourceId
Generate a new SourceId
fn get_file_path_and_content(&self, source_id: SourceId) -> (PathBuf, String)
fn get_file_path(&self, source_id: SourceId) -> PathBuf
fn get_file_content(&self, source_id: SourceId) -> String
fn get_file_whole_span(&self, source_id: SourceId) -> SpanWithSource
Auto Trait Implementations§
impl<T> Freeze for MapFileStore<T>where
T: Freeze,
impl<T> RefUnwindSafe for MapFileStore<T>where
T: RefUnwindSafe,
impl<T> Send for MapFileStore<T>where
T: Send,
impl<T> Sync for MapFileStore<T>where
T: Sync,
impl<T> Unpin for MapFileStore<T>where
T: Unpin,
impl<T> UnwindSafe for MapFileStore<T>where
T: UnwindSafe,
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