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 html_auto_generate(self, enabled: bool) -> Self
pub fn html_auto_generate(self, enabled: bool) -> Self
Enable HTML report auto-generation.
Sourcepub fn html_output_dir(self, dir: PathBuf) -> Self
pub fn html_output_dir(self, dir: PathBuf) -> Self
Set HTML report output directory.
Sourcepub fn quality_enabled(self, enabled: bool) -> Self
pub fn quality_enabled(self, enabled: bool) -> Self
Enable or disable quality checking.
When enabled, all ISO 8000/25012 quality metrics are calculated:
- Completeness (null detection)
- Consistency (type consistency, mixed types)
- Uniqueness (duplicate detection, high cardinality)
- Accuracy (outlier detection)
- Timeliness (stale data detection)
Sourcepub fn iso_quality_thresholds(self, thresholds: IsoQualityConfig) -> Self
pub fn iso_quality_thresholds(self, thresholds: IsoQualityConfig) -> Self
Set custom ISO quality thresholds.
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 db_connection_timeout(self, seconds: u64) -> Self
pub fn db_connection_timeout(self, seconds: u64) -> Self
Set database connection timeout in seconds.
Sourcepub fn db_batch_size(self, size: usize) -> Self
pub fn db_batch_size(self, size: usize) -> Self
Set database batch size for queries.
Sourcepub fn db_sampling_enabled(self, enabled: bool) -> Self
pub fn db_sampling_enabled(self, enabled: bool) -> Self
Enable or disable database sampling.
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>
pub fn build(self) -> Result<DataprofConfig>
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.
Trait Implementations§
Source§impl Clone for DataprofConfigBuilder
impl Clone for DataprofConfigBuilder
Source§fn clone(&self) -> DataprofConfigBuilder
fn clone(&self) -> DataprofConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DataprofConfigBuilder
impl Debug for DataprofConfigBuilder
Auto Trait Implementations§
impl Freeze for DataprofConfigBuilder
impl RefUnwindSafe for DataprofConfigBuilder
impl Send for DataprofConfigBuilder
impl Sync for DataprofConfigBuilder
impl Unpin for DataprofConfigBuilder
impl UnwindSafe for DataprofConfigBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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