Struct xtask_watch::Watch

source ·
#[non_exhaustive]
pub struct Watch { pub watch_paths: Vec<PathBuf>, pub exclude_paths: Vec<PathBuf>, pub workspace_exclude_paths: Vec<PathBuf>, pub debounce: Duration, }
Expand description

Watches over your project’s source code, relaunching a given command when changes are detected.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§watch_paths: Vec<PathBuf>

Watch specific file(s) or folder(s).

The default is the workspace root.

§exclude_paths: Vec<PathBuf>

Paths that will be excluded.

§workspace_exclude_paths: Vec<PathBuf>

Paths, relative to the workspace root, that will be excluded.

§debounce: Duration

Throttle events to prevent the command to be re-executed too early right after an execution already occurred.

The default is 2 seconds.

Implementations§

Add a path to watch for changes.

Add multiple paths to watch for changes.

Add a path that will be ignored if changes are detected.

Add multiple paths that will be ignored if changes are detected.

Add a path, relative to the workspace, that will be ignored if changes are detected.

Add multiple paths, relative to the workspace, that will be ignored if changes are detected.

Set the debounce duration after relaunching the command.

Run the given command, monitor the watched paths and relaunch the command when changes are detected.

Workspace’s target directory and hidden paths are excluded by default.

Trait Implementations§

Report the ArgGroup::id for this set of arguments
Append to Command so it can instantiate Self. Read more
Append to Command so it can update self. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Build a Command that can instantiate Self. Read more
Build a Command that can update self. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Assign values from ArgMatches to self.
Assign values from ArgMatches to self.
Parse from std::env::args_os(), exit on error
Parse from std::env::args_os(), return Err on error.
Parse from iterator, exit on error
Parse from iterator, return Err on error.
Update from iterator, exit on error
Update from iterator, return Err on error.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.