Struct watchexec::config::RuntimeConfig
source · [−]#[non_exhaustive]pub struct RuntimeConfig {
pub fs: WorkingData,
pub action: WorkingData,
}
Expand description
Runtime configuration for Watchexec
.
This is used both when constructing the instance (as initial configuration) and to reconfigure
it at runtime via Watchexec::reconfigure()
.
Use RuntimeConfig::default()
to build a new one, or modify an existing one. This struct is
marked non-exhaustive such that new options may be added without breaking change. You can make
changes through the fields directly, or use the convenience (chainable!) methods instead.
Another advantage of using the convenience methods is that each one contains a call to the
debug!
macro, providing insight into what config your application sets for “free”.
You should see the detailed documentation on fs::WorkingData and action::WorkingData for important information and particulars about each field, especially the handlers.
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.fs: WorkingData
Working data for the filesystem event source.
This notably includes the path set to be watched.
action: WorkingData
Working data for the action processing.
This is the task responsible for scheduling the actions in response to events, applying the filtering, etc.
Implementations
sourceimpl RuntimeConfig
impl RuntimeConfig
sourcepub fn pathset<I, P>(&mut self, pathset: I) -> &mut Selfwhere
I: IntoIterator<Item = P>,
P: AsRef<Path>,
pub fn pathset<I, P>(&mut self, pathset: I) -> &mut Selfwhere
I: IntoIterator<Item = P>,
P: AsRef<Path>,
Set the pathset to be watched.
sourcepub fn file_watcher(&mut self, watcher: Watcher) -> &mut Self
pub fn file_watcher(&mut self, watcher: Watcher) -> &mut Self
Set the file watcher type to use.
sourcepub fn action_throttle(&mut self, throttle: impl Into<Duration>) -> &mut Self
pub fn action_throttle(&mut self, throttle: impl Into<Duration>) -> &mut Self
Set the action throttle.
sourcepub fn command_grouped(&mut self, grouped: bool) -> &mut Self
pub fn command_grouped(&mut self, grouped: bool) -> &mut Self
Toggle whether to use process groups or not.
sourcepub fn command(&mut self, command: Command) -> &mut Self
pub fn command(&mut self, command: Command) -> &mut Self
Set a single command to run on action.
This is a convenience for .commands(vec![Command...])
.
sourcepub fn commands(&mut self, commands: impl Into<Vec<Command>>) -> &mut Self
pub fn commands(&mut self, commands: impl Into<Vec<Command>>) -> &mut Self
Set the commands to run on action.
sourcepub fn filterer(&mut self, filterer: Arc<dyn Filterer>) -> &mut Self
pub fn filterer(&mut self, filterer: Arc<dyn Filterer>) -> &mut Self
Set the filterer implementation to use.
sourcepub fn on_action(
&mut self,
handler: impl Handler<Action> + Send + 'static
) -> &mut Self
pub fn on_action(
&mut self,
handler: impl Handler<Action> + Send + 'static
) -> &mut Self
Set the action handler.
Trait Implementations
sourceimpl Clone for RuntimeConfig
impl Clone for RuntimeConfig
sourcefn clone(&self) -> RuntimeConfig
fn clone(&self) -> RuntimeConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RuntimeConfig
impl Debug for RuntimeConfig
sourceimpl Default for RuntimeConfig
impl Default for RuntimeConfig
sourcefn default() -> RuntimeConfig
fn default() -> RuntimeConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for RuntimeConfig
impl Send for RuntimeConfig
impl Sync for RuntimeConfig
impl Unpin for RuntimeConfig
impl !UnwindSafe for RuntimeConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more