pub struct DataprofConfigBuilder { /* private fields */ }Expand description
Builder for constructing DataprofConfig with a fluent API.
The builder pattern provides:
- Clear, self-documenting configuration
- Type-safe construction
- Validation at build time
- Easy preset configurations
§Examples
use dataprof_core::config::{DataprofConfigBuilder, IsoQualityConfig};
// Simple configuration with defaults
let config = DataprofConfigBuilder::new()
.build()
.expect("Failed to build config");
// Configuration with custom settings
let config = DataprofConfigBuilder::new()
.output_format("json")
.verbosity(2)
.engine("streaming")
.build()
.expect("Failed to build config");
// Strict quality profile for finance/healthcare
let config = DataprofConfigBuilder::new()
.iso_quality_profile_strict()
.build()
.expect("Failed to build config");Implementations§
Source§impl DataprofConfigBuilder
impl DataprofConfigBuilder
Sourcepub fn output_format(self, format: &str) -> Self
pub fn output_format(self, format: &str) -> Self
Set the default output format.
Valid formats: “text”, “json”, “csv”, “plain”
Sourcepub fn verbosity(self, level: u8) -> Self
pub fn verbosity(self, level: u8) -> Self
Set verbosity level (0=quiet, 1=normal, 2=verbose, 3=debug).
Sourcepub fn show_progress(self, enabled: bool) -> Self
pub fn show_progress(self, enabled: bool) -> Self
Enable or disable progress bars.
Sourcepub fn quality_enabled(self, enabled: bool) -> Self
pub fn quality_enabled(self, enabled: bool) -> Self
Enable or disable quality checking.
When enabled, all quality dimensions are calculated:
- Completeness (null detection)
- Consistency (type consistency, mixed types)
- Uniqueness (duplicate detection, high cardinality)
- Accuracy (outlier detection)
- Timeliness (stale data detection)
- Validity (semantic pattern conformance)
- Precision (effective decimal-scale consistency)
Sourcepub fn iso_quality_thresholds(self, thresholds: IsoQualityConfig) -> Self
pub fn iso_quality_thresholds(self, thresholds: IsoQualityConfig) -> Self
Set custom quality thresholds and score settings.
Sourcepub fn quality_score_weights(self, weights: QualityScoreWeights) -> Self
pub fn quality_score_weights(self, weights: QualityScoreWeights) -> Self
Set relative weights for the overall quality score.
Sourcepub fn iso_quality_profile_strict(self) -> Self
pub fn iso_quality_profile_strict(self) -> Self
Use strict ISO quality thresholds (finance, healthcare).
Stricter thresholds for high-compliance industries:
- Lower null tolerance (30% vs 50%)
- Higher type consistency requirements (98% vs 95%)
- Stricter duplicate detection (1% vs 5%)
- More recent data requirements (2 years vs 5 years)
Sourcepub fn iso_quality_profile_lenient(self) -> Self
pub fn iso_quality_profile_lenient(self) -> Self
Use lenient ISO quality thresholds (exploratory, marketing).
More relaxed thresholds for exploratory data:
- Higher null tolerance (70% vs 50%)
- Lower type consistency requirements (90% vs 95%)
- More lenient duplicate detection (10% vs 5%)
- Older data accepted (10 years vs 5 years)
Sourcepub fn engine(self, engine: &str) -> Self
pub fn engine(self, engine: &str) -> Self
Set the default engine selection.
Valid engines: “auto”, “streaming”, “memory_efficient”, “true_streaming”
Sourcepub fn chunk_size(self, size: usize) -> Self
pub fn chunk_size(self, size: usize) -> Self
Set default chunk size for streaming operations.
Sourcepub fn max_concurrent(self, max: usize) -> Self
pub fn max_concurrent(self, max: usize) -> Self
Set maximum concurrent operations.
Sourcepub fn max_memory_mb(self, mb: usize) -> Self
pub fn max_memory_mb(self, mb: usize) -> Self
Set maximum memory usage in MB (0 = unlimited).
Sourcepub fn auto_streaming_threshold_mb(self, mb: f64) -> Self
pub fn auto_streaming_threshold_mb(self, mb: f64) -> Self
Set auto-streaming threshold in MB.
Sourcepub fn ci_preset() -> Self
pub fn ci_preset() -> Self
Create a configuration optimized for CI/CD pipelines.
- No colors (for log compatibility)
- No progress bars (cleaner output)
- JSON output format
- Verbose logging
Sourcepub fn interactive_preset() -> Self
pub fn interactive_preset() -> Self
Create a configuration for interactive terminal use.
- Colors enabled
- Progress bars enabled
- Text output format
- Normal verbosity
Sourcepub fn production_quality_preset() -> Self
pub fn production_quality_preset() -> Self
Create a configuration for production quality checks.
- Strict ISO quality thresholds
- Quality checking enabled
- Memory monitoring enabled
- Conservative memory limits
Sourcepub fn build(self) -> Result<DataprofConfig, DataProfilerError>
pub fn build(self) -> Result<DataprofConfig, DataProfilerError>
Build the configuration and validate it.
Returns an error if the configuration is invalid.
Sourcepub fn build_unchecked(self) -> DataprofConfig
pub fn build_unchecked(self) -> DataprofConfig
Build the configuration without validation.
Use this only if you’re certain the configuration is valid and want to skip validation for performance reasons.