pub struct ValidationSuiteBuilder { /* private fields */ }Expand description
Builder for constructing ValidationSuite instances.
§Examples
use term_guard::core::{ValidationSuite, Check, Level};
use term_guard::telemetry::TermTelemetry;
let suite = ValidationSuite::builder("quality_checks")
.description("Data quality validation suite")
.check(
Check::builder("completeness")
.level(Level::Error)
.build()
)
.build();
// Or with telemetry:
let telemetry = TermTelemetry::disabled();
let suite_with_telemetry = ValidationSuite::builder("quality_checks")
.with_telemetry(telemetry)
.build();Implementations§
Source§impl ValidationSuiteBuilder
impl ValidationSuiteBuilder
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates a new validation suite builder with the given name.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Sets the description for the validation suite.
§Arguments
description- A description of the suite’s purpose
Sourcepub fn table_name(self, table_name: impl Into<String>) -> Self
pub fn table_name(self, table_name: impl Into<String>) -> Self
Sets the table name to validate.
By default, validation runs against a table named “data”. Use this method to validate a different table, which is especially useful when working with database sources.
§Arguments
table_name- The name of the table to validate
§Examples
use term_guard::core::ValidationSuite;
let suite = ValidationSuite::builder("customer_validation")
.table_name("customer_transactions")
.build();Sourcepub fn checks<I>(self, checks: I) -> Selfwhere
I: IntoIterator<Item = Check>,
pub fn checks<I>(self, checks: I) -> Selfwhere
I: IntoIterator<Item = Check>,
Sourcepub fn with_telemetry(self, telemetry: TermTelemetry) -> Self
pub fn with_telemetry(self, telemetry: TermTelemetry) -> Self
Sets the telemetry configuration for the suite.
§Arguments
telemetry- The telemetry configuration to use
Sourcepub fn with_optimizer(self, enabled: bool) -> Self
pub fn with_optimizer(self, enabled: bool) -> Self
Sets whether to use the query optimizer for execution.
When enabled, the suite will attempt to optimize constraint execution by batching similar queries together. If optimization fails, it will fall back to sequential execution.
§Arguments
enabled- Whether to enable query optimization
§Examples
use term_guard::core::ValidationSuite;
let suite = ValidationSuite::builder("optimized_suite")
.with_optimizer(true)
.build();Sourcepub fn build(self) -> ValidationSuite
pub fn build(self) -> ValidationSuite
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ValidationSuiteBuilder
impl !RefUnwindSafe for ValidationSuiteBuilder
impl Send for ValidationSuiteBuilder
impl Sync for ValidationSuiteBuilder
impl Unpin for ValidationSuiteBuilder
impl !UnwindSafe for ValidationSuiteBuilder
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
Mutably borrows from an owned value. Read more
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>
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 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>
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