pub struct HotReloadTracker { /* private fields */ }Expand description
Tracks shader source modification times to support hot reload.
In production this would watch file system events; here timestamps are set manually for testing.
Implementations§
Source§impl HotReloadTracker
impl HotReloadTracker
Sourcepub fn touch(&mut self, name: impl Into<String>, time: u64)
pub fn touch(&mut self, name: impl Into<String>, time: u64)
Record a modification for name at the given logical time.
Sourcepub fn record_compile(&mut self, name: impl Into<String>, time: u64)
pub fn record_compile(&mut self, name: impl Into<String>, time: u64)
Record that name was compiled at the given logical time.
Sourcepub fn needs_recompile(&self, name: &str) -> bool
pub fn needs_recompile(&self, name: &str) -> bool
Returns true when name has been modified since it was last compiled.
Sourcepub fn stale_shaders(&self) -> Vec<&str>
pub fn stale_shaders(&self) -> Vec<&str>
Return all shader names that need recompilation.
Source§impl HotReloadTracker
impl HotReloadTracker
Sourcepub fn touch_batch(&mut self, names: &[&str], time: u64)
pub fn touch_batch(&mut self, names: &[&str], time: u64)
Touch multiple shaders at once with the same logical timestamp.
Sourcepub fn flush_stale(&mut self, time: u64)
pub fn flush_stale(&mut self, time: u64)
Record that all currently stale shaders have been recompiled at time.
Sourcepub fn never_compiled(&self) -> Vec<&str>
pub fn never_compiled(&self) -> Vec<&str>
Return the set of shader names that have been modified but never compiled.
Trait Implementations§
Source§impl Debug for HotReloadTracker
impl Debug for HotReloadTracker
Source§impl Default for HotReloadTracker
impl Default for HotReloadTracker
Source§fn default() -> HotReloadTracker
fn default() -> HotReloadTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HotReloadTracker
impl RefUnwindSafe for HotReloadTracker
impl Send for HotReloadTracker
impl Sync for HotReloadTracker
impl Unpin for HotReloadTracker
impl UnsafeUnpin for HotReloadTracker
impl UnwindSafe for HotReloadTracker
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more