Skip to main content

Module utils

Module utils 

Source
Expand description

Shared utility functions for the CLM Rust Core.

This module consolidates commonly used helper functions that were previously duplicated across multiple source files. Centralizing them here follows the DRY (Don’t Repeat Yourself) principle and ensures consistent behavior.

Re-exports§

pub use crate::cross_cutting::context::CLMContext;

Functions§

assert_within
Asserts a test’s wall-clock bound measured < bound (INV-589), mirroring tests/timing.py.
capture_process_output
Captures stdout and stderr from a std::process::Output as owned Strings.
collect_clm_mock_vars
Collects all CLM_MOCK_* environment variables, filtering them from the current process environment.
indent_lines
Indents each non-empty line of a string by the specified number of spaces.
is_zero_fs
Returns true if the CLM runtime is operating in Zero-File-System mode.
now_iso8601
Returns the current local timestamp in ISO 8601 format: %Y-%m-%dT%H:%M:%S%z.
remove_env_var
Removes an environment variable.
set_env_var
Sets an environment variable.

Type Aliases§

EvaluationContext
Compatibility alias for crate::cross_cutting::context::CLMContext (INV-490, DoD-490-06).