Skip to main content

CustomSchemaCategory

Struct CustomSchemaCategory 

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

A user-defined blocking category assembled from individual rules.

Build one with the fluent with_* methods and pass it to BlockerFactory::from_custom_category.

§Example

use zer_blocking::{BlockerFactory, CustomSchemaCategory};
use zer_blocking::keys::DateGranularity;

let category = CustomSchemaCategory::new()
    .with_phonetic_name_dob()
    .with_id_suffix(4)
    .with_exact_categorical();

// let blocker = BlockerFactory::from_custom_category(&schema, category);

Implementations§

Source§

impl CustomSchemaCategory

Source

pub fn new() -> Self

Source

pub fn with_phone_suffix(self, n: usize) -> Self

Add a SuffixKey(n) on every Phone field.

Source

pub fn with_id_suffix(self, n: usize) -> Self

Add a SuffixKey(n) on every Id field (digits-only suffix).

Source

pub fn with_document_suffix(self, n: usize) -> Self

Add a DocumentSuffixKey(n) on every Id field (alphanumeric suffix, uppercased).

Source

pub fn with_exact_categorical(self) -> Self

Add an ExactFieldKey on every Categorical field.

Source

pub fn with_date_fragment(self, granularity: DateGranularity) -> Self

Add a DateFragmentKey with the given granularity on the first Date field.

Source

pub fn with_phonetic_name_dob(self) -> Self

Add a PhoneticNameDobKey using the last Name field and the first Date field.

Source

pub fn with_phonetic_name_dob_initial(self) -> Self

Add a PhoneticNameDobInitialKey (surname phonetic + first-name initial + DOB year). Falls back to PhoneticNameDobKey when only one Name field is present.

Source

pub fn with_address_initial(self) -> Self

Add an AddressInitialKey using the first Address field and first Name field as initial.

Source

pub fn with_key(self, key: impl BlockingKey + 'static) -> Self

Add an arbitrary blocking key, escape hatch for keys the built-in rules don’t cover.

Trait Implementations§

Source§

impl Default for CustomSchemaCategory

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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.