Skip to main content

BatchCommands

Enum BatchCommands 

Source
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

§files: Vec<String>

Input file paths (supports glob patterns)

§strict: bool

Strict mode (fail on any error)

§parallel: bool

Force parallel processing

§verbose: bool

Show verbose progress

§streaming: bool

Use 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.

§auto_streaming: bool

Automatically use streaming for files > 100MB

Enables hybrid mode where large files use streaming and small files use standard processing for optimal performance and memory usage.

§max_files: Option<usize>

Maximum number of files to process (unlimited if not specified)

§

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

§files: Vec<String>

Input file paths (supports glob patterns)

§output_dir: Option<String>

Output directory for formatted files

§check: bool

Check only (exit 1 if not canonical)

§ditto: bool

Use ditto optimization

§with_counts: bool

Automatically add count hints to all matrix lists

§parallel: bool

Force parallel processing

§verbose: bool

Show verbose progress

§max_files: Option<usize>

Maximum number of files to process (unlimited if not specified)

§

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.

Fields

§files: Vec<String>

Input file paths (supports glob patterns)

§warn_error: bool

Treat warnings as errors

§parallel: bool

Force parallel processing

§verbose: bool

Show verbose progress

§max_files: Option<usize>

Maximum number of files to process (unlimited if not specified)

Implementations§

Source§

impl BatchCommands

Source

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

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for BatchCommands

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,