ConditionBuilder

Struct ConditionBuilder 

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

A Condition builder, used with StatementBuilder::if_condition().

Implementations§

Source§

impl ConditionBuilder

Source

pub fn new(operator: GlobalConditionOperator) -> Self

Create a new Condition with the provided operator.

Source

pub fn new_string_equals() -> Self

Create a new Condition with operator = StringEquals

Source

pub fn new_string_not_equals() -> Self

Create a new Condition with operator = StringNotEquals

Source

pub fn new_numeric_equals() -> Self

Create a new Condition with operator = NumericEquals

Source

pub fn new_numeric_not_equals() -> Self

Create a new Condition with operator = NumericNotEquals

Source

pub fn new_bool() -> Self

Create a new Condition with operator = Bool

Source

pub fn for_all(&mut self) -> &mut Self

Add the for-all-values quantifier.

Source

pub fn for_any(&mut self) -> &mut Self

Add the for-any-value quantifier.

Source

pub fn right_hand_side( &mut self, key: &str, values: &mut Vec<ConditionValue>, ) -> &mut Self

Add a list of values to the right-hand-sidse of this condition.

Source

pub fn right_hand_str(&mut self, key: &str, value: &str) -> &mut Self

Add a string value to the right-hand-sidse of this condition.

Source

pub fn right_hand_int(&mut self, key: &str, value: i64) -> &mut Self

Add a integer value to the right-hand-sidse of this condition.

Source

pub fn right_hand_float(&mut self, key: &str, value: f64) -> &mut Self

Add a float value to the right-hand-sidse of this condition.

Source

pub fn right_hand_bool(&mut self, key: &str, value: bool) -> &mut Self

Add a boolean value to the right-hand-sidse of this condition.

Source

pub fn if_exists(&mut self) -> &mut Self

Add the if-exists constraint

Source

pub fn build_as_condition( &self, ) -> HashMap<ConditionOperator, HashMap<QString, OneOrAll<ConditionValue>>>

Convert this one condition into a complete Condition for a statement.

Trait Implementations§

Source§

impl Debug for ConditionBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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, 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.