tinymist_vfs

Trait FsProvider

Source
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§

Source

fn file_path(&self, id: FileId) -> FileResult<PathResolution>

Gets the file path corresponding to the given id.

Source

fn read(&self, id: FileId) -> FileResult<Bytes>

Gets the file content corresponding to the given id.

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.

Implementors§