pub enum Constraint {
Eq(String, Value),
Ne(String, Value),
Gt(String, Value),
Gte(String, Value),
Lt(String, Value),
Lte(String, Value),
Like(String, String),
NotLike(String, String),
In(String, Vec<Value>),
NotIn(String, Vec<Value>),
Null(String),
NotNull(String),
}Expand description
One recorded predicate.
Variants§
Eq(String, Value)
column = value.
Ne(String, Value)
column <> value.
Gt(String, Value)
column > value.
Gte(String, Value)
column >= value.
Lt(String, Value)
column < value.
Lte(String, Value)
column <= value.
Like(String, String)
column LIKE pattern.
NotLike(String, String)
column NOT LIKE pattern.
In(String, Vec<Value>)
column IN (values).
NotIn(String, Vec<Value>)
column NOT IN (values).
Null(String)
column IS NULL.
NotNull(String)
column IS NOT NULL.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn as_equality(&self) -> Option<(&str, &Value)>
pub fn as_equality(&self) -> Option<(&str, &Value)>
The (column, value) pair if this is an equality, else None.
Shard routing keys off equalities specifically: user_id = 42 names one
shard, whereas user_id > 42 could span all of them.
Sourcepub fn to_expr(&self, column: ColumnRef) -> SimpleExpr
pub fn to_expr(&self, column: ColumnRef) -> SimpleExpr
Render as a sea_query expression against an already-resolved column.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnsafeUnpin for Constraint
impl UnwindSafe for Constraint
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> Event for T
impl<T> Event for T
Source§fn event_name() -> &'static strwhere
Self: Sized,
fn event_name() -> &'static strwhere
Self: Sized,
A human-readable name, used by wildcard listeners and log output.
Always the Rust type path; see the trait docs.