[][src]Struct hotglsl::Watch

pub struct Watch { /* fields omitted */ }

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 Watchers 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]

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]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,