pub enum UniquenessType {
FullUniqueness {
threshold: f64,
},
Distinctness(Assertion),
UniqueValueRatio(Assertion),
PrimaryKey,
UniqueWithNulls {
threshold: f64,
null_handling: NullHandling,
},
UniqueComposite {
threshold: f64,
null_handling: NullHandling,
case_sensitive: bool,
},
}Expand description
Type of uniqueness validation to perform.
This enum encompasses all the different types of uniqueness checks that were previously handled by separate constraint types.
Variants§
FullUniqueness
Full uniqueness validation with configurable threshold.
Replaces the functionality of UniquenessConstraint.
Validates that at least threshold ratio of values are unique.
Distinctness(Assertion)
Distinctness validation using flexible assertions.
Replaces the functionality of DistinctnessConstraint.
Validates the ratio of distinct values using assertion-based logic.
UniqueValueRatio(Assertion)
Unique value ratio validation using flexible assertions.
Replaces the functionality of UniqueValueRatioConstraint.
Validates the ratio of values that appear exactly once.
PrimaryKey
Primary key validation (unique + non-null).
Replaces the functionality of PrimaryKeyConstraint.
Enforces that values are both unique and contain no NULLs.
UniqueWithNulls
Uniqueness validation that allows NULL values.
Similar to FullUniqueness but with explicit NULL handling control.
UniqueComposite
Composite uniqueness with advanced null handling.
Optimized for multi-column uniqueness checks with configurable null handling strategies.
Implementations§
Trait Implementations§
Source§impl Clone for UniquenessType
impl Clone for UniquenessType
Source§fn clone(&self) -> UniquenessType
fn clone(&self) -> UniquenessType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UniquenessType
impl Debug for UniquenessType
Source§impl PartialEq for UniquenessType
impl PartialEq for UniquenessType
impl StructuralPartialEq for UniquenessType
Auto Trait Implementations§
impl Freeze for UniquenessType
impl RefUnwindSafe for UniquenessType
impl Send for UniquenessType
impl Sync for UniquenessType
impl Unpin for UniquenessType
impl UnwindSafe for UniquenessType
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> 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>
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