Config

Struct Config 

Source
pub struct Config {
Show 14 fields pub project: ProjectConfig, pub generation: GenerationConfig, pub types: TypeConfig, pub performance: PerformanceConfig, pub filesystem: FilesystemConfig, pub output_dir: String, pub skip_functions: Vec<String>, pub type_mappings: HashMap<String, String>, pub include_private: bool, pub parallel: bool, pub parallel_chunk_size: usize, pub respect_gitignore: bool, pub skip_patterns: Vec<String>, pub timeout_seconds: u64,
}
Expand description

Enhanced hierarchical configuration for GitOps-style workflows.

Supports cascading configuration sources with environment override capabilities:

  1. Global user config (~/.config/auto_test/{config.toml,yaml})
  2. Project-specific config ({project}/.auto_test.{toml,yaml})
  3. Environment variables (AUTO_TEST_*)
  4. Inline overrides via CLI flags

Fields§

§project: ProjectConfig

Project metadata for GitOps workflows

§generation: GenerationConfig

Generation strategy and behavior

§types: TypeConfig

Type-safe parameter generation

§performance: PerformanceConfig

Performance and execution control

§filesystem: FilesystemConfig

File discovery and filtering

§output_dir: String§skip_functions: Vec<String>§type_mappings: HashMap<String, String>§include_private: bool§parallel: bool§parallel_chunk_size: usize§respect_gitignore: bool§skip_patterns: Vec<String>§timeout_seconds: u64

Implementations§

Source§

impl Config

Source

pub fn load(project_root: &Path) -> Result<Self>

Load configuration from the standard locations in a project root.

Looks for configuration files in this order:

  1. auto_test.toml
  2. auto_test.yaml
  3. Default configuration

Supports both legacy flat format and new hierarchical format.

§Arguments
  • project_root - Path to the project root directory
§Returns

The loaded configuration, or an error if loading fails

Source

pub fn load_from_file(path: &Path) -> Result<Self>

Load configuration from a specific file path.

Handles both legacy flat format and new hierarchical format for backward compatibility.

§Arguments
  • path - Path to the configuration file
§Returns

The loaded configuration, or an error if loading fails

Source

pub fn save_to_file(&self, path: &Path) -> Result<()>

Save the current configuration to a TOML file.

§Arguments
  • path - Path where to save the configuration file
§Returns

Ok if saving succeeded, or an error

Source

pub fn get_type_mapping(&self, type_name: &str) -> Option<&String>

Get the value for a type mapping, falling back to defaults.

§Arguments
  • type_name - The type name to look up
§Returns

The mapped value if found, None otherwise

Source

pub fn should_skip_function(&self, function_name: &str) -> bool

Check if a function should be skipped based on configuration.

§Arguments
  • function_name - The name of the function to check
§Returns

True if the function should be skipped

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config
where Config: Default,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<LegacyConfig> for Config

Source§

fn from(legacy: LegacyConfig) -> Self

Converts to this type from the input type.
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,