Trait source_map::FileSystem
source · pub trait FileSystem: Sized {
// Required methods
fn new_source_id(&mut self, path: PathBuf, content: String) -> SourceId;
fn get_file<T, F: for<'a> FnOnce(&'a Path, &'a str) -> T>(
&self,
source_id: SourceId,
f: F
) -> T;
// Provided methods
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) -> Span { ... }
fn get_file_slice<I: SliceIndex<str>>(
&self,
source_id: SourceId,
indexer: I
) -> Option<<I::Output as ToOwned>::Owned>
where I::Output: Sized + ToOwned { ... }
}
Required Methods§
sourcefn new_source_id(&mut self, path: PathBuf, content: String) -> SourceId
fn new_source_id(&mut self, path: PathBuf, content: String) -> SourceId
Generate the