Struct xtask_wasm::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
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§
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 group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id
][crate::ArgGroup::id] for this set of argumentssource§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
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
.