pub struct WatchConfig {
pub paths: Vec<PathBuf>,
pub debounce_ms: u64,
pub clear_screen: bool,
pub cli_config: CliConfig,
pub filter_pattern: Option<String>,
pub timebox_ms: Option<u64>,
}Expand description
Configuration for file watching
Fields§
§paths: Vec<PathBuf>Paths to watch (files or directories)
debounce_ms: u64Debounce delay in milliseconds
clear_screen: boolWhether to clear screen between test runs
cli_config: CliConfigCLI configuration for test execution
filter_pattern: Option<String>Optional filter pattern for scenario selection (substring match on path)
timebox_ms: Option<u64>Optional timebox limit in milliseconds per scenario
Implementations§
Source§impl WatchConfig
impl WatchConfig
Sourcepub fn new(paths: Vec<PathBuf>, debounce_ms: u64, clear_screen: bool) -> Self
pub fn new(paths: Vec<PathBuf>, debounce_ms: u64, clear_screen: bool) -> Self
Create new watch configuration
§Arguments
paths- Paths to watch for changesdebounce_ms- Milliseconds to wait before triggering (typically 200-500ms)clear_screen- Whether to clear terminal between runs
§Example
use clnrm_core::watch::WatchConfig;
use std::path::PathBuf;
let config = WatchConfig::new(
vec![PathBuf::from("tests/")],
300,
true
);Sourcepub fn with_cli_config(self, cli_config: CliConfig) -> Self
pub fn with_cli_config(self, cli_config: CliConfig) -> Self
Add CLI configuration for test execution
§Arguments
cli_config- CLI configuration to use when running tests
§Example
use clnrm_core::watch::WatchConfig;
use clnrm_core::cli::types::CliConfig;
use std::path::PathBuf;
let config = WatchConfig::new(
vec![PathBuf::from("tests/")],
300,
false
).with_cli_config(CliConfig::default());Sourcepub fn with_filter_pattern(self, pattern: String) -> Self
pub fn with_filter_pattern(self, pattern: String) -> Self
Add filter pattern for scenario selection
Only scenarios whose paths contain this substring will be executed.
§Arguments
pattern- Substring to match against scenario file paths
§Example
use clnrm_core::watch::WatchConfig;
use std::path::PathBuf;
let config = WatchConfig::new(
vec![PathBuf::from("tests/")],
300,
false
).with_filter_pattern("otel".to_string());Sourcepub fn with_timebox(self, timebox_ms: u64) -> Self
pub fn with_timebox(self, timebox_ms: u64) -> Self
Add timebox limit for scenario execution
Scenarios that exceed this time limit will be terminated.
§Arguments
timebox_ms- Maximum execution time in milliseconds
§Example
use clnrm_core::watch::WatchConfig;
use std::path::PathBuf;
let config = WatchConfig::new(
vec![PathBuf::from("tests/")],
300,
false
).with_timebox(5000);Sourcepub fn has_filter_pattern(&self) -> bool
pub fn has_filter_pattern(&self) -> bool
Check if a filter pattern is set
Sourcepub fn has_timebox(&self) -> bool
pub fn has_timebox(&self) -> bool
Check if a timebox is set
Trait Implementations§
Source§impl Clone for WatchConfig
impl Clone for WatchConfig
Source§fn clone(&self) -> WatchConfig
fn clone(&self) -> WatchConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WatchConfig
impl RefUnwindSafe for WatchConfig
impl Send for WatchConfig
impl Sync for WatchConfig
impl Unpin for WatchConfig
impl UnwindSafe for WatchConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request