pub struct ShaderHotReloadManager { /* private fields */ }Expand description
Manages shader source files and detects changes for hot-reloading.
Implementations§
Source§impl ShaderHotReloadManager
impl ShaderHotReloadManager
Sourcepub fn watch(&mut self, name: &str, source: &str)
pub fn watch(&mut self, name: &str, source: &str)
Start watching a shader file with initial source.
Sourcepub fn update(&mut self, name: &str, new_source: &str) -> bool
pub fn update(&mut self, name: &str, new_source: &str) -> bool
Update a shader’s source. Returns true if the source changed.
Sourcepub fn is_watched(&self, name: &str) -> bool
pub fn is_watched(&self, name: &str) -> bool
Check if a shader is being watched.
Sourcepub fn get_source(&self, name: &str) -> Option<&str>
pub fn get_source(&self, name: &str) -> Option<&str>
Get the current source for a watched shader.
Sourcepub fn watched_names(&self) -> Vec<&str>
pub fn watched_names(&self) -> Vec<&str>
Return names of all watched shaders.
Trait Implementations§
Source§impl Debug for ShaderHotReloadManager
impl Debug for ShaderHotReloadManager
Source§impl Default for ShaderHotReloadManager
impl Default for ShaderHotReloadManager
Source§fn default() -> ShaderHotReloadManager
fn default() -> ShaderHotReloadManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ShaderHotReloadManager
impl RefUnwindSafe for ShaderHotReloadManager
impl Send for ShaderHotReloadManager
impl Sync for ShaderHotReloadManager
impl Unpin for ShaderHotReloadManager
impl UnsafeUnpin for ShaderHotReloadManager
impl UnwindSafe for ShaderHotReloadManager
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