pub struct NormalizerChain { /* private fields */ }Expand description
An ordered set of folds, applied left to right.
fingerprint joins the keys. A deployment that maintains
a folded column stores the fingerprint beside it: when the chain changes, the
stored values were folded by the old chain and need a backfill, and comparing
fingerprints is how that is noticed rather than silently mismatching.
Implementations§
Source§impl NormalizerChain
impl NormalizerChain
pub fn new() -> Self
pub fn with(self, fold: impl Normalizer) -> Self
Sourcepub fn standard() -> Self
pub fn standard() -> Self
Case, diacritics, punctuation, whitespace: the fold a lookup wants unless it has a reason to differ.
pub fn fold(&self, text: &str) -> String
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
The chain’s identity: its keys in order. Store it beside folded data to detect a chain change that invalidates it.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for NormalizerChain
impl Clone for NormalizerChain
Source§fn clone(&self) -> NormalizerChain
fn clone(&self) -> NormalizerChain
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for NormalizerChain
impl Default for NormalizerChain
Source§fn default() -> NormalizerChain
fn default() -> NormalizerChain
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for NormalizerChain
impl !UnwindSafe for NormalizerChain
impl Freeze for NormalizerChain
impl Send for NormalizerChain
impl Sync for NormalizerChain
impl Unpin for NormalizerChain
impl UnsafeUnpin for NormalizerChain
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<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> ⓘ
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 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> ⓘ
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