pub struct ConstraintOptions {
pub operator: Option<LogicalOperator>,
pub threshold: Option<f64>,
pub flags: HashMap<String, bool>,
pub options: HashMap<String, String>,
}Expand description
Common options for constraint configuration.
This struct provides a builder pattern for common constraint options that can be extended by specific constraint types.
Fields§
§operator: Option<LogicalOperator>The logical operator for multi-column constraints
threshold: Option<f64>Threshold value (interpretation depends on constraint type)
flags: HashMap<String, bool>Additional boolean flags
options: HashMap<String, String>Additional string options
Implementations§
Source§impl ConstraintOptions
impl ConstraintOptions
Sourcepub fn with_operator(self, operator: LogicalOperator) -> Self
pub fn with_operator(self, operator: LogicalOperator) -> Self
Sets the logical operator.
Sourcepub fn with_threshold(self, threshold: f64) -> Self
pub fn with_threshold(self, threshold: f64) -> Self
Sets the threshold value.
Sourcepub fn with_option(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_option( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Sets a string option.
Sourcepub fn operator_or(&self, default: LogicalOperator) -> LogicalOperator
pub fn operator_or(&self, default: LogicalOperator) -> LogicalOperator
Returns the operator or a default value.
Sourcepub fn threshold_or(&self, default: f64) -> f64
pub fn threshold_or(&self, default: f64) -> f64
Returns the threshold or a default value.
Trait Implementations§
Source§impl Clone for ConstraintOptions
impl Clone for ConstraintOptions
Source§fn clone(&self) -> ConstraintOptions
fn clone(&self) -> ConstraintOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConstraintOptions
impl Debug for ConstraintOptions
Source§impl Default for ConstraintOptions
impl Default for ConstraintOptions
Source§fn default() -> ConstraintOptions
fn default() -> ConstraintOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConstraintOptions
impl RefUnwindSafe for ConstraintOptions
impl Send for ConstraintOptions
impl Sync for ConstraintOptions
impl Unpin for ConstraintOptions
impl UnwindSafe for ConstraintOptions
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