pub struct FilterCondition {
pub field: String,
pub operator: FilterOperator,
pub value: FilterValue,
pub logical: FilterLogical,
pub column_type: Option<String>,
}Expand description
A single filter condition
Fields§
§field: String§operator: FilterOperator§value: FilterValue§logical: FilterLogical§column_type: Option<String>Implementations§
Source§impl FilterCondition
impl FilterCondition
Sourcepub fn new(field: String, operator: FilterOperator, value: FilterValue) -> Self
pub fn new(field: String, operator: FilterOperator, value: FilterValue) -> Self
Create a new filter condition
Sourcepub fn with_logical(self, logical: FilterLogical) -> Self
pub fn with_logical(self, logical: FilterLogical) -> Self
Set the logical operator
Sourcepub fn with_column_type(self, column_type: String) -> Self
pub fn with_column_type(self, column_type: String) -> Self
Set the column type for casting (e.g., “user_status”)
Sourcepub fn build_sql(&self, param_idx: &mut usize) -> String
pub fn build_sql(&self, param_idx: &mut usize) -> String
Build SQL WHERE clause for this condition (with logical prefix)
Sourcepub fn get_params(&self) -> Vec<String>
pub fn get_params(&self) -> Vec<String>
Get the parameter values for binding
Trait Implementations§
Source§impl Clone for FilterCondition
impl Clone for FilterCondition
Auto Trait Implementations§
impl Freeze for FilterCondition
impl RefUnwindSafe for FilterCondition
impl Send for FilterCondition
impl Sync for FilterCondition
impl Unpin for FilterCondition
impl UnsafeUnpin for FilterCondition
impl UnwindSafe for FilterCondition
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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