parent
f3e0f0cbda
commit
ec26a99b7d
|
@ -125,7 +125,9 @@ pub enum RuntimeError {
|
||||||
#[diagnostic(code(watchexec::runtime::clearscreen))]
|
#[diagnostic(code(watchexec::runtime::clearscreen))]
|
||||||
Clearscreen(#[from] clearscreen::Error),
|
Clearscreen(#[from] clearscreen::Error),
|
||||||
|
|
||||||
/// Error received when parsing a glob (possibly from an [`IgnoreFile`](crate::ignore::files::IgnoreFile)) fails.
|
/// Error received when parsing a glob (possibly from an [`IgnoreFile`]) fails.
|
||||||
|
///
|
||||||
|
/// [`IgnoreFile`]: crate::ignore::IgnoreFile
|
||||||
#[error("cannot parse glob from ignore '{file:?}': {err}")]
|
#[error("cannot parse glob from ignore '{file:?}': {err}")]
|
||||||
#[diagnostic(code(watchexec::runtime::ignore_glob))]
|
#[diagnostic(code(watchexec::runtime::ignore_glob))]
|
||||||
GlobsetGlob {
|
GlobsetGlob {
|
||||||
|
@ -138,7 +140,9 @@ pub enum RuntimeError {
|
||||||
// TODO: extract glob error into diagnostic
|
// TODO: extract glob error into diagnostic
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Error received when an [`IgnoreFile`](crate::ignore::files::IgnoreFile) cannot be read.
|
/// Error received when an [`IgnoreFile`] cannot be read.
|
||||||
|
///
|
||||||
|
/// [`IgnoreFile`]: crate::ignore::IgnoreFile
|
||||||
#[error("cannot read ignore '{file}': {err}")]
|
#[error("cannot read ignore '{file}': {err}")]
|
||||||
#[diagnostic(code(watchexec::runtime::ignore_file_read))]
|
#[diagnostic(code(watchexec::runtime::ignore_file_read))]
|
||||||
IgnoreFileRead {
|
IgnoreFileRead {
|
||||||
|
@ -153,7 +157,7 @@ pub enum RuntimeError {
|
||||||
/// Error emitted by a [`Filterer`](crate::filter::Filterer).
|
/// Error emitted by a [`Filterer`](crate::filter::Filterer).
|
||||||
///
|
///
|
||||||
/// With built-in filterers this will probably be a dynbox of
|
/// With built-in filterers this will probably be a dynbox of
|
||||||
/// [`TaggedFiltererError`](crate::filter::tagged::error::TaggedFiltererError), but it is
|
/// [`TaggedFiltererError`](crate::error::TaggedFiltererError), but it is
|
||||||
/// possible to use a custom filterer which emits a different error type.
|
/// possible to use a custom filterer which emits a different error type.
|
||||||
#[error("{kind} filterer: {err}")]
|
#[error("{kind} filterer: {err}")]
|
||||||
#[diagnostic(code(watchexec::runtime::filterer))]
|
#[diagnostic(code(watchexec::runtime::filterer))]
|
||||||
|
|
|
@ -20,7 +20,7 @@ use super::files::IgnoreFile;
|
||||||
///
|
///
|
||||||
/// This reads and compiles ignore files, and should be used for handling ignore files. It's created
|
/// This reads and compiles ignore files, and should be used for handling ignore files. It's created
|
||||||
/// with a project origin and a list of ignore files, and new ignore files can be added later
|
/// with a project origin and a list of ignore files, and new ignore files can be added later
|
||||||
/// (unless [`finish`](Filter::finish()) is called).
|
/// (unless [`finish`](IgnoreFilterer::finish()) is called).
|
||||||
///
|
///
|
||||||
/// It implements [`Filterer`] so it can be used directly in another filterer; it is not designed to
|
/// It implements [`Filterer`] so it can be used directly in another filterer; it is not designed to
|
||||||
/// be used as a standalone filterer.
|
/// be used as a standalone filterer.
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
//! }
|
//! }
|
||||||
//! });
|
//! });
|
||||||
//!
|
//!
|
||||||
|
//! we.reconfigure(runtime);
|
||||||
//! we.main().await.into_diagnostic()?;
|
//! we.main().await.into_diagnostic()?;
|
||||||
//! Ok(())
|
//! Ok(())
|
||||||
//! }
|
//! }
|
||||||
|
|
|
@ -54,6 +54,17 @@ impl Watchexec {
|
||||||
///
|
///
|
||||||
/// Returns an [`Arc`] for convenience; use [`try_unwrap`][Arc::try_unwrap()] to get the value
|
/// Returns an [`Arc`] for convenience; use [`try_unwrap`][Arc::try_unwrap()] to get the value
|
||||||
/// directly if needed.
|
/// directly if needed.
|
||||||
|
///
|
||||||
|
/// Note that `RuntimeConfig` is not a "live" or "shared" instance: if using reconfiguration,
|
||||||
|
/// you'll usually pass a `clone()` of your `RuntimeConfig` instance to this function; changes
|
||||||
|
/// made to the instance you _keep_ will not automatically be used by Watchexec, you need to
|
||||||
|
/// call [`reconfigure()`](Watchexec::reconfigure) with your updated config to apply the changes.
|
||||||
|
///
|
||||||
|
/// Watchexec will subscribe to most signals sent to the process it runs in and send them, as
|
||||||
|
/// [`Event`]s, to the action handler. At minimum, you should check for interrupt/ctrl-c events
|
||||||
|
/// and return an [`Outcome::Exit`], otherwise hitting ctrl-c will do nothing.
|
||||||
|
///
|
||||||
|
/// [`Outcome::Exit`]: crate::action::Outcome::Exit
|
||||||
pub fn new(
|
pub fn new(
|
||||||
mut init: InitConfig,
|
mut init: InitConfig,
|
||||||
mut runtime: RuntimeConfig,
|
mut runtime: RuntimeConfig,
|
||||||
|
|
Loading…
Reference in New Issue