pub struct DataQualityInjector { /* private fields */ }Expand description
Main data quality injector.
Implementations§
Source§impl DataQualityInjector
impl DataQualityInjector
Sourcepub fn new(config: DataQualityConfig) -> Self
pub fn new(config: DataQualityConfig) -> Self
Creates a new data quality injector.
Sourcepub fn set_country_pack(&mut self, pack: CountryPack)
pub fn set_country_pack(&mut self, pack: CountryPack)
Set the country pack for locale-aware format variation baselines.
Propagates to the internal FormatVariationInjector so that date and
amount baselines reflect the country’s locale conventions.
Sourcepub fn process_text_field(
&mut self,
field: &str,
value: &str,
record_id: &str,
context: &HashMap<String, String>,
) -> Option<String>
pub fn process_text_field( &mut self, field: &str, value: &str, record_id: &str, context: &HashMap<String, String>, ) -> Option<String>
Processes a text field, potentially introducing quality issues.
Sourcepub fn process_date_field(
&mut self,
field: &str,
date: NaiveDate,
record_id: &str,
context: &HashMap<String, String>,
) -> Option<String>
pub fn process_date_field( &mut self, field: &str, date: NaiveDate, record_id: &str, context: &HashMap<String, String>, ) -> Option<String>
Processes a date field, potentially introducing format variations.
Sourcepub fn process_amount_field(
&mut self,
field: &str,
amount: Decimal,
record_id: &str,
context: &HashMap<String, String>,
) -> Option<String>
pub fn process_amount_field( &mut self, field: &str, amount: Decimal, record_id: &str, context: &HashMap<String, String>, ) -> Option<String>
Processes an amount field, potentially introducing format variations.
Sourcepub fn process_identifier_field(
&mut self,
field: &str,
id: &str,
record_id: &str,
context: &HashMap<String, String>,
) -> Option<String>
pub fn process_identifier_field( &mut self, field: &str, id: &str, record_id: &str, context: &HashMap<String, String>, ) -> Option<String>
Processes an identifier field, potentially introducing variations.
Sourcepub fn should_duplicate(&mut self) -> bool
pub fn should_duplicate(&mut self) -> bool
Determines if a record should be duplicated.
Sourcepub fn stats(&self) -> &DataQualityStats
pub fn stats(&self) -> &DataQualityStats
Returns statistics.
Sourcepub fn issues(&self) -> &[QualityIssue]
pub fn issues(&self) -> &[QualityIssue]
Returns all recorded issues.
Sourcepub fn issues_for_record(&self, record_id: &str) -> Vec<&QualityIssue>
pub fn issues_for_record(&self, record_id: &str) -> Vec<&QualityIssue>
Returns issues for a specific record.
Sourcepub fn issues_by_type(&self, issue_type: QualityIssueType) -> Vec<&QualityIssue>
pub fn issues_by_type(&self, issue_type: QualityIssueType) -> Vec<&QualityIssue>
Returns issues of a specific type.
Sourcepub fn update_stats(&mut self)
pub fn update_stats(&mut self)
Updates aggregate statistics.
Auto Trait Implementations§
impl Freeze for DataQualityInjector
impl RefUnwindSafe for DataQualityInjector
impl Send for DataQualityInjector
impl Sync for DataQualityInjector
impl Unpin for DataQualityInjector
impl UnsafeUnpin for DataQualityInjector
impl UnwindSafe for DataQualityInjector
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.