Skip to main content

CoreCommands

Enum CoreCommands 

Source
pub enum CoreCommands {
    Validate {
        file: String,
        strict: bool,
        lenient: bool,
    },
    Format {
        file: String,
        output: Option<String>,
        check: bool,
        ditto: bool,
        with_counts: bool,
    },
    Lint {
        file: String,
        format: String,
        warn_error: bool,
    },
    Inspect {
        file: String,
        verbose: bool,
    },
    Stats {
        file: String,
        tokens: bool,
    },
}
Expand description

Core HEDL commands.

These commands provide the essential functionality for working with HEDL files: validation, formatting, linting, inspection, and statistics.

§Commands

  • Validate: Check HEDL syntax and semantic correctness
  • Format: Convert to canonical form with optional optimizations
  • Lint: Check for best practices and style issues
  • Inspect: Visualize internal structure
  • Stats: Analyze size and token efficiency

Variants§

§

Validate

Validate a HEDL file

Checks the syntax and semantic correctness of a HEDL file. In strict mode, all references must resolve to existing entities.

Fields

§file: String

Input file path

§strict: bool

Strict reference validation (all references must resolve)

§lenient: bool

Use lenient parsing mode (constraint violations become null)

§

Format

Format a HEDL file to canonical form

Reformats a HEDL file to its canonical representation. Supports various formatting options including ditto optimization and automatic count hints.

Fields

§file: String

Input file path

§output: Option<String>

Output file path (defaults to stdout)

§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

§

Lint

Lint a HEDL file for best practices

Analyzes a HEDL file for style issues, best practices violations, and potential problems. Can output results in text or JSON format.

Fields

§file: String

Input file path

§format: String

Output format (text, json)

§warn_error: bool

Treat warnings as errors

§

Inspect

Print parsed structure (debug)

Displays the internal structure of a HEDL file as a tree, useful for debugging and understanding how HEDL parses the file.

Fields

§file: String

Input file path

§verbose: bool

Show detailed internal structure

§

Stats

Show size/token savings vs other formats

Analyzes a HEDL file and compares its size and token count against equivalent representations in JSON, YAML, XML, CSV, and Parquet.

Fields

§file: String

Input HEDL file

§tokens: bool

Show estimated token counts for LLM context

Implementations§

Source§

impl CoreCommands

Source

pub fn execute(self) -> Result<(), CliError>

Execute the core command.

§Returns

Returns Ok(()) on success, or an error message on failure.

§Errors

Returns Err if the command execution fails.

Trait Implementations§

Source§

impl FromArgMatches for CoreCommands

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 CoreCommands

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,