Trait source_map::FileSystem
source · pub trait FileSystem: Sized {
// Required methods
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;
// Provided methods
fn new_source_id(&mut self, path: PathBuf, content: String) -> 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 { ... }
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§
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
Provided Methods§
sourcefn 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
Object Safety§
This trait is not object safe.