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
impl CustomSchemaCategory
pub fn new() -> Self
Sourcepub fn with_phone_suffix(self, n: usize) -> Self
pub fn with_phone_suffix(self, n: usize) -> Self
Add a SuffixKey(n) on every Phone field.
Sourcepub fn with_id_suffix(self, n: usize) -> Self
pub fn with_id_suffix(self, n: usize) -> Self
Add a SuffixKey(n) on every Id field (digits-only suffix).
Sourcepub fn with_document_suffix(self, n: usize) -> Self
pub fn with_document_suffix(self, n: usize) -> Self
Add a DocumentSuffixKey(n) on every Id field (alphanumeric suffix, uppercased).
Sourcepub fn with_exact_categorical(self) -> Self
pub fn with_exact_categorical(self) -> Self
Add an ExactFieldKey on every Categorical field.
Sourcepub fn with_date_fragment(self, granularity: DateGranularity) -> Self
pub fn with_date_fragment(self, granularity: DateGranularity) -> Self
Add a DateFragmentKey with the given granularity on the first Date field.
Sourcepub fn with_phonetic_name_dob(self) -> Self
pub fn with_phonetic_name_dob(self) -> Self
Add a PhoneticNameDobKey using the last Name field and the first Date field.
Sourcepub fn with_phonetic_name_dob_initial(self) -> Self
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.
Sourcepub fn with_address_initial(self) -> Self
pub fn with_address_initial(self) -> Self
Add an AddressInitialKey using the first Address field and first Name field as initial.
Sourcepub fn with_key(self, key: impl BlockingKey + 'static) -> Self
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§
Auto Trait Implementations§
impl Freeze for CustomSchemaCategory
impl !RefUnwindSafe for CustomSchemaCategory
impl Send for CustomSchemaCategory
impl Sync for CustomSchemaCategory
impl Unpin for CustomSchemaCategory
impl UnsafeUnpin for CustomSchemaCategory
impl !UnwindSafe for CustomSchemaCategory
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
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>
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>
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