#[non_exhaustive]pub struct Watch {
pub shell_commands: Vec<String>,
pub cargo_commands: Vec<String>,
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
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.shell_commands: Vec<String>
Shell command(s) to execute on changes.
cargo_commands: Vec<String>
Cargo command(s) to execute on changes.
The default is [ check ]
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§
Source§impl Watch
impl Watch
Sourcepub fn watch_path(self, path: impl AsRef<Path>) -> Self
pub fn watch_path(self, path: impl AsRef<Path>) -> Self
Add a path to watch for changes.
Sourcepub fn watch_paths(
self,
paths: impl IntoIterator<Item = impl AsRef<Path>>,
) -> Self
pub fn watch_paths( self, paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Self
Add multiple paths to watch for changes.
Sourcepub fn exclude_path(self, path: impl AsRef<Path>) -> Self
pub fn exclude_path(self, path: impl AsRef<Path>) -> Self
Add a path that will be ignored if changes are detected.
Sourcepub fn exclude_paths(
self,
paths: impl IntoIterator<Item = impl AsRef<Path>>,
) -> Self
pub fn exclude_paths( self, paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Self
Add multiple paths that will be ignored if changes are detected.
Sourcepub fn exclude_workspace_path(self, path: impl AsRef<Path>) -> Self
pub fn exclude_workspace_path(self, path: impl AsRef<Path>) -> Self
Add a path, relative to the workspace, that will be ignored if changes are detected.
Sourcepub fn exclude_workspace_paths(
self,
paths: impl IntoIterator<Item = impl AsRef<Path>>,
) -> Self
pub fn exclude_workspace_paths( self, paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Self
Add multiple paths, relative to the workspace, that will be ignored if changes are detected.
Trait Implementations§
Source§impl Args for Watch
impl Args for Watch
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command
so it can instantiate self
via
FromArgMatches::update_from_arg_matches_mut
Read moreSource§impl CommandFactory for Watch
impl CommandFactory for Watch
Source§impl FromArgMatches for Watch
impl FromArgMatches for Watch
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.