#[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: DurationThrottle 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>) -> Watch
pub fn watch_path(self, path: impl AsRef<Path>) -> Watch
Add a path to watch for changes.
Sourcepub fn watch_paths(
self,
paths: impl IntoIterator<Item = impl AsRef<Path>>,
) -> Watch
pub fn watch_paths( self, paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Watch
Add multiple paths to watch for changes.
Sourcepub fn exclude_path(self, path: impl AsRef<Path>) -> Watch
pub fn exclude_path(self, path: impl AsRef<Path>) -> Watch
Add a path that will be ignored if changes are detected.
Sourcepub fn exclude_paths(
self,
paths: impl IntoIterator<Item = impl AsRef<Path>>,
) -> Watch
pub fn exclude_paths( self, paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Watch
Add multiple paths that will be ignored if changes are detected.
Sourcepub fn exclude_workspace_path(self, path: impl AsRef<Path>) -> Watch
pub fn exclude_workspace_path(self, path: impl AsRef<Path>) -> Watch
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>>,
) -> Watch
pub fn exclude_workspace_paths( self, paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Watch
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<Watch, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Watch, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Watch, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Watch, 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.Source§impl Parser for Watch
impl Parser for Watch
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for Watch
impl RefUnwindSafe for Watch
impl Send for Watch
impl Sync for Watch
impl Unpin for Watch
impl UnsafeUnpin for Watch
impl UnwindSafe for Watch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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