pub trait FsProvider {
// Required methods
fn file_path(&self, id: FileId) -> FileResult<PathResolution>;
fn read(&self, id: FileId) -> FileResult<Bytes>;
fn read_source(&self, id: FileId) -> FileResult<Source>;
}
Expand description
A trait to perform file system query.
Required Methods§
Sourcefn file_path(&self, id: FileId) -> FileResult<PathResolution>
fn file_path(&self, id: FileId) -> FileResult<PathResolution>
Gets the file path corresponding to the given id
.
Sourcefn read(&self, id: FileId) -> FileResult<Bytes>
fn read(&self, id: FileId) -> FileResult<Bytes>
Gets the file content corresponding to the given id
.
Sourcefn read_source(&self, id: FileId) -> FileResult<Source>
fn read_source(&self, id: FileId) -> FileResult<Source>
Gets the source code corresponding to the given id
. It is preferred to
be used for source files so that parsing is reused across editions.