Enum FilterCondition

Source
pub enum FilterCondition {
Show 22 variants StringValue { column: String, operator: FilterOperator, value: Option<String>, }, FixedStringValue { column: String, operator: FilterOperator, value: Option<String>, }, UInt8Value { column: String, operator: FilterOperator, value: Option<u8>, }, UInt16Value { column: String, operator: FilterOperator, value: Option<u16>, }, UInt32Value { column: String, operator: FilterOperator, value: Option<u32>, }, UInt64Value { column: String, operator: FilterOperator, value: Option<u64>, }, Int8Value { column: String, operator: FilterOperator, value: Option<i8>, }, Int16Value { column: String, operator: FilterOperator, value: Option<i16>, }, Int32Value { column: String, operator: FilterOperator, value: Option<i32>, }, Int64Value { column: String, operator: FilterOperator, value: Option<i64>, }, Float32Value { column: String, operator: FilterOperator, value: Option<f32>, }, Float64Value { column: String, operator: FilterOperator, value: Option<f64>, }, DateValue { column: String, operator: FilterOperator, value: Option<String>, }, DateTimeValue { column: String, operator: FilterOperator, value: Option<String>, }, DateTime64Value { column: String, operator: FilterOperator, value: Option<String>, }, DateRange { column: String, range_type: DateRangeType, }, BooleanValue { column: String, operator: FilterOperator, value: Option<bool>, }, UUIDValue { column: String, operator: FilterOperator, value: Option<String>, }, InValues { column: String, operator: FilterOperator, values: Vec<String>, column_type: Option<ColumnTypeInfo>, }, ArrayContains { column: String, operator: FilterOperator, value: String, }, ArrayHas { column: String, operator: FilterOperator, value: String, }, JSONValue { column: String, operator: FilterOperator, value: Option<String>, path: Option<String>, },
}
Expand description

Filter condition - represents a single comparison

Variants§

§

StringValue

Fields

§column: String
§

FixedStringValue

Fields

§column: String
§

UInt8Value

Fields

§column: String
§value: Option<u8>
§

UInt16Value

Fields

§column: String
§value: Option<u16>
§

UInt32Value

Fields

§column: String
§value: Option<u32>
§

UInt64Value

Fields

§column: String
§value: Option<u64>
§

Int8Value

Fields

§column: String
§value: Option<i8>
§

Int16Value

Fields

§column: String
§value: Option<i16>
§

Int32Value

Fields

§column: String
§value: Option<i32>
§

Int64Value

Fields

§column: String
§value: Option<i64>
§

Float32Value

Fields

§column: String
§value: Option<f32>
§

Float64Value

Fields

§column: String
§value: Option<f64>
§

DateValue

Fields

§column: String
§

DateTimeValue

Fields

§column: String
§

DateTime64Value

Fields

§column: String
§

DateRange

Fields

§column: String
§range_type: DateRangeType
§

BooleanValue

Fields

§column: String
§value: Option<bool>
§

UUIDValue

Fields

§column: String
§

InValues

Fields

§column: String
§values: Vec<String>
§column_type: Option<ColumnTypeInfo>
§

ArrayContains

Fields

§column: String
§value: String
§

ArrayHas

Fields

§column: String
§value: String
§

JSONValue

Fields

§column: String

Implementations§

Source§

impl FilterCondition

Source

pub fn to_sql(&self, case_insensitive: bool) -> Result<String>

Source

pub fn string( column: &str, operator: FilterOperator, value: Option<&str>, ) -> Self

Source

pub fn fixed_string( column: &str, operator: FilterOperator, value: Option<&str>, ) -> Self

Source

pub fn uint8(column: &str, operator: FilterOperator, value: Option<u8>) -> Self

Source

pub fn uint32( column: &str, operator: FilterOperator, value: Option<u32>, ) -> Self

Source

pub fn int32(column: &str, operator: FilterOperator, value: Option<i32>) -> Self

Source

pub fn int64(column: &str, operator: FilterOperator, value: Option<i64>) -> Self

Source

pub fn float64( column: &str, operator: FilterOperator, value: Option<f64>, ) -> Self

Source

pub fn date(column: &str, operator: FilterOperator, value: Option<&str>) -> Self

Source

pub fn date_time( column: &str, operator: FilterOperator, value: Option<&str>, ) -> Self

Source

pub fn boolean( column: &str, operator: FilterOperator, value: Option<bool>, ) -> Self

Source

pub fn uuid(column: &str, operator: FilterOperator, value: Option<&str>) -> Self

Source

pub fn json( column: &str, operator: FilterOperator, value: Option<&str>, path: Option<&str>, ) -> Self

Source

pub fn array_contains(column: &str, values: &str) -> Self

Source

pub fn array_has(column: &str, value: &str) -> Self

Source

pub fn date_exact(column: &str, timestamp: &str) -> Self

Source

pub fn date_only(column: &str, date: &str) -> Self

Source

pub fn date_range(column: &str, start: &str, end: &str) -> Self

Source

pub fn relative_date(column: &str, expr: &str) -> Self

Source

pub fn in_values( column: &str, operator: FilterOperator, values: Vec<String>, column_type: Option<ColumnTypeInfo>, ) -> Self

Trait Implementations§

Source§

impl Clone for FilterCondition

Source§

fn clone(&self) -> FilterCondition

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilterCondition

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for FilterCondition

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for FilterCondition

Source§

fn eq(&self, other: &FilterCondition) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for FilterCondition

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.