pub enum BatchCommands {
BatchValidate {
files: Vec<String>,
strict: bool,
parallel: bool,
verbose: bool,
streaming: bool,
auto_streaming: bool,
max_files: Option<usize>,
},
BatchFormat {
files: Vec<String>,
output_dir: Option<String>,
check: bool,
ditto: bool,
with_counts: bool,
parallel: bool,
verbose: bool,
max_files: Option<usize>,
},
BatchLint {
files: Vec<String>,
warn_error: bool,
parallel: bool,
verbose: bool,
max_files: Option<usize>,
},
}Expand description
Batch processing commands.
These commands operate on multiple HEDL files simultaneously, with automatic parallelization for improved performance. All batch commands support glob patterns for file selection.
§Performance
Batch commands automatically use parallel processing when beneficial:
- CPU-bound operations scale with available cores
- I/O-bound operations use async parallelization
- Progress reporting shows real-time status
§Design
All batch commands follow consistent patterns:
- Multiple file inputs (with glob support)
- Optional parallel processing flag
- Verbose mode for detailed progress
Variants§
BatchValidate
Batch validate multiple HEDL files
Validates multiple HEDL files in parallel. Supports glob patterns for file selection and provides aggregated results.
Fields
streaming: boolUse streaming mode for memory-efficient processing
Streaming mode uses constant memory regardless of file size, making it ideal for files > 100MB or memory-constrained environments.
BatchFormat
Batch format multiple HEDL files
Formats multiple HEDL files to canonical form in parallel. Can either modify files in-place or write to an output directory.
Fields
BatchLint
Batch lint multiple HEDL files
Lints multiple HEDL files in parallel, checking for best practices and style issues. Provides aggregated results across all files.
Implementations§
Source§impl BatchCommands
impl BatchCommands
Sourcepub fn execute(self) -> Result<(), CliError>
pub fn execute(self) -> Result<(), CliError>
Execute the batch command.
§Returns
Returns Ok(()) on success, or an error message on failure.
§Errors
Returns Err if:
- No files match the provided patterns
- Any file operation fails
- Processing fails for any file
§Performance
Batch commands automatically parallelize when beneficial. The parallel
flag forces parallelization even for small file sets.
Trait Implementations§
Source§impl FromArgMatches for BatchCommands
impl FromArgMatches for BatchCommands
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, 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<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for BatchCommands
impl Subcommand for BatchCommands
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for BatchCommands
impl RefUnwindSafe for BatchCommands
impl Send for BatchCommands
impl Sync for BatchCommands
impl Unpin for BatchCommands
impl UnwindSafe for BatchCommands
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> 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