pub struct HotReloadState { /* private fields */ }Expand description
State for tracking file changes.
Implementations§
Source§impl HotReloadState
impl HotReloadState
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Initializes the file-tracking context.
To register a shader for change-tracking call Shader::watch_sources once with the state
returned by this function.
To register a file for change-tracking, call HotReloadState::watch_file.
Sourcepub fn update_changes(&mut self)
pub fn update_changes(&mut self)
Saves in self the set of watched files that changed since the last time this function
was called.
Once this call completes, the Self::file_changed method can be used to check if a
particular file (assuming it was added to the watch list with Self::watch_file) has
changed since the last time [Self::updated_changes] was called.
Sourcepub fn watch_file(&mut self, path: &Path) -> Result<()>
pub fn watch_file(&mut self, path: &Path) -> Result<()>
Registers a files for change-tracking.
Sourcepub fn file_changed(&self, path: &Path) -> bool
pub fn file_changed(&self, path: &Path) -> bool
Checks if the specified file change was detected at the time of calling Self::update_changes.
Auto Trait Implementations§
impl Freeze for HotReloadState
impl RefUnwindSafe for HotReloadState
impl Send for HotReloadState
impl Sync for HotReloadState
impl !Unpin for HotReloadState
impl UnwindSafe for HotReloadState
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
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.