Struct mun_vfs::VirtualFileSystem
source · pub struct VirtualFileSystem { /* private fields */ }
Expand description
The VirtualFileSystem
is a struct that manages a set of files and their content. Changes to
the instance are logged, they can be be retrieved via the take_changes
method.
Implementations§
source§impl VirtualFileSystem
impl VirtualFileSystem
sourcepub fn has_changes(&self) -> bool
pub fn has_changes(&self) -> bool
Returns true
if there are changes that can be processed.
sourcepub fn take_changes(&mut self) -> Vec<ChangedFile>
pub fn take_changes(&mut self) -> Vec<ChangedFile>
Returns the changes performed on the instance since the last time this function was called or since the creation of the instance.
sourcepub fn file_id(&self, path: &AbsPath) -> Option<FileId>
pub fn file_id(&self, path: &AbsPath) -> Option<FileId>
Returns the FileId
of the file at the specified path
or None
if there is no data for
that file.
sourcepub fn file_path(&self, file_id: FileId) -> &AbsPath
pub fn file_path(&self, file_id: FileId) -> &AbsPath
Returns the path of the file with the specified FileId
.
sourcepub fn file_contents(&self, file_id: FileId) -> Option<&[u8]>
pub fn file_contents(&self, file_id: FileId) -> Option<&[u8]>
Returns the content of the file with the specified FileId
.
Trait Implementations§
source§impl Default for VirtualFileSystem
impl Default for VirtualFileSystem
source§fn default() -> VirtualFileSystem
fn default() -> VirtualFileSystem
Returns the “default value” for a type. Read more