Struct re_renderer::FileServer
source · pub struct FileServer { /* private fields */ }Expand description
A file server capable of watching filesystem events in the background and resolve #import clauses in files.
Implementations§
source§impl FileServer
impl FileServer
sourcepub fn get<T>(f: impl FnMut(&FileServer) -> T) -> T
pub fn get<T>(f: impl FnMut(&FileServer) -> T) -> T
Returns a reference to the global FileServer.
sourcepub fn get_mut<T>(f: impl FnMut(&mut FileServer) -> T) -> T
pub fn get_mut<T>(f: impl FnMut(&mut FileServer) -> T) -> T
Returns a mutable reference to the global FileServer.
source§impl FileServer
impl FileServer
sourcepub fn watch<Fs: FileSystem>(
&mut self,
resolver: &mut FileResolver<Fs>,
path: impl AsRef<Path>,
recursive: bool
) -> Result<PathBuf>
pub fn watch<Fs: FileSystem>( &mut self, resolver: &mut FileResolver<Fs>, path: impl AsRef<Path>, recursive: bool ) -> Result<PathBuf>
Starts watching for file events at the given path.
The given path is canonicalized.
sourcepub fn unwatch(&mut self, path: impl AsRef<Path>) -> Result<()>
pub fn unwatch(&mut self, path: impl AsRef<Path>) -> Result<()>
Stops watching for file events at the given path.
sourcepub fn collect<Fs: FileSystem>(
&mut self,
resolver: &mut FileResolver<Fs>
) -> HashSet<PathBuf>
pub fn collect<Fs: FileSystem>( &mut self, resolver: &mut FileResolver<Fs> ) -> HashSet<PathBuf>
Coalesces all filesystem events since the last call to collect,
and returns a set of all modified paths.
Auto Trait Implementations§
impl RefUnwindSafe for FileServer
impl Send for FileServer
impl Sync for FileServer
impl Unpin for FileServer
impl UnwindSafe for FileServer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more