Skip to main content

DataQualityInjector

Struct DataQualityInjector 

Source
pub struct DataQualityInjector { /* private fields */ }
Expand description

Main data quality injector.

Implementations§

Source§

impl DataQualityInjector

Source

pub fn new(config: DataQualityConfig) -> Self

Creates a new data quality injector.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn should_duplicate(&mut self) -> bool

Determines if a record should be duplicated.

Source

pub fn stats(&self) -> &DataQualityStats

Returns statistics.

Source

pub fn issues(&self) -> &[QualityIssue]

Returns all recorded issues.

Source

pub fn issues_for_record(&self, record_id: &str) -> Vec<&QualityIssue>

Returns issues for a specific record.

Source

pub fn issues_by_type(&self, issue_type: QualityIssueType) -> Vec<&QualityIssue>

Returns issues of a specific type.

Source

pub fn reset(&mut self)

Resets all statistics and issues.

Source

pub fn update_stats(&mut self)

Updates aggregate statistics.

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V