[−][src]Struct hotglsl::Watch
Watches one or more paths for changes to GLSL shader files.
See the watch
or watch_paths
constructor functions.
Methods
impl Watch
[src]
pub fn await_event(&self) -> Result<(), AwaitEventError>
[src]
Block the current thread until some filesystem event has been received from notify.
This is useful when running the hotloading process on a separate thread.
pub fn try_next_path(&self) -> Result<Option<PathBuf>, NextPathError>
[src]
Checks for a new filesystem event.
If the event relates to a shader file, the path to that event is returned.
If the event relates to multiple shader files, the remaining files are buffered until the
next call to next
or try_next
.
Returns an Err
if the channel was closed or if one of the notify Watcher
s sent us an
error.
pub fn paths_touched(&self) -> Result<HashSet<PathBuf>, NextPathError>
[src]
Returns all unique paths that have been changed at least once since the last call to
paths_touched
or compile_touched
.
This uses try_next_path
internally to collect all pending paths into a set containing
each unique path only once.
pub fn compile_touched(
&self
) -> Result<impl Iterator<Item = (PathBuf, Result<Vec<u8>, CompileError>)>, NextPathError>
[src]
&self
) -> Result<impl Iterator<Item = (PathBuf, Result<Vec<u8>, CompileError>)>, NextPathError>
Produce an iterator that compiles each touched shader file to SPIR-V.
Compilation of each file only begins on the produced iterator's next
call.
Auto Trait Implementations
impl !RefUnwindSafe for Watch
impl Send for Watch
impl !Sync for Watch
impl Unpin for Watch
impl !UnwindSafe for Watch
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,