Skip to main content

BlockerFactory

Struct BlockerFactory 

Source
pub struct BlockerFactory;

Implementations§

Source§

impl BlockerFactory

Source

pub fn from_schema(schema: &Schema) -> CompositeBlocker

Build a CompositeBlocker whose blocking keys are chosen automatically from the Schema’s FieldKind annotations.

Priority rules (applied in order):

  • 2+ Name fields + Date: uses PhoneticNameDobInitialKey (surname phonetic + first-name initial + DOB year)
  • 1 Name field + Date: uses PhoneticNameDobKey (surname phonetic + DOB year)
  • Name + Address: uses AddressInitialKey (first address token + first name initial)
  • Phone: adds SuffixKey(7) on the first Phone field
  • Id: adds SuffixKey(4) on each Id field
  • Date only (no Name): adds DateFragmentKey(YearMonth) on the first Date field
  • Categorical: adds ExactFieldKey on each Categorical field
Source

pub fn from_custom_category( schema: &Schema, cat: CustomSchemaCategory, ) -> CompositeBlocker

Build a CompositeBlocker from a user-defined CustomSchemaCategory.

Each rule in the category is applied in order against schema’s FieldKind annotations. Rules that reference field kinds not present in the schema are silently skipped, no panic, no empty blocker.

Source

pub fn from_schema_category( schema: &Schema, category: SchemaCategory, ) -> CompositeBlocker

Build a CompositeBlocker tuned for a specific domain category.

Keys are chosen based on both the category semantics and the FieldKind annotations present in schema.

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

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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.