Skip to main content

FieldPred

Enum FieldPred 

Source
pub enum FieldPred {
Show 16 variants Eq(String, Value), Ne(String, Value), Gt(String, f64), Gte(String, f64), Lt(String, f64), Lte(String, f64), Contains(String, String), StartsWith(String, String), Exists(String, bool), IsNull(String, bool), In(String, Vec<Value>), Nin(String, Vec<Value>), EndsWith(String, String), Id(String), DatetimeComponent { field: String, which: u8, value: i64, }, Type(String, String),
}
Expand description

A single-field predicate inside a where expression.

Variants§

§

Eq(String, Value)

$eq equality; $eq:null is an explicit alias for the is-null state predicate.

§

Ne(String, Value)

$ne inequality; the field must be present for the predicate to match.

§

Gt(String, f64)

$gt numeric/datetime strictly-greater comparison.

§

Gte(String, f64)

$gte numeric/datetime greater-than-or-equal comparison.

§

Lt(String, f64)

$lt numeric/datetime strictly-less comparison.

§

Lte(String, f64)

$lte numeric/datetime less-than-or-equal comparison.

§

Contains(String, String)

$contains case-insensitive substring match on a string.

§

StartsWith(String, String)

$startsWith case-insensitive prefix match on a string.

§

Exists(String, bool)

$exists presence test; the flag selects present (true) or absent.

§

IsNull(String, bool)

$isNull/$eq:null null-state test; the flag selects null (true) or non-null.

§

In(String, Vec<Value>)

$in membership against a set of literal values.

§

Nin(String, Vec<Value>)

$nin non-membership; the field must be present and match none of the values.

§

EndsWith(String, String)

$endsWith case-insensitive suffix match on a string.

§

Id(String)

$id — match the record identity itself.

§

DatetimeComponent

Datetime component predicate: { created: { $year: 2023 } }. which = 0..6 (year/month/day/hour/minute/second/millisecond).

Fields

§field: String

Normalized property name the component is read from.

§which: u8

Component selector: 0=year, 1=month, 2=day, 3=hour, 4=minute, 5=second, 6=millisecond.

§value: i64

Expected component value.

§

Type(String, String)

$type operator: “string” | “number” | “boolean” | “array” | “object”

Trait Implementations§

Source§

impl Clone for FieldPred

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldPred

Source§

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

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

impl<'de> Deserialize<'de> for FieldPred

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FieldPred

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for FieldPred

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FieldPred

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Same for T

Source§

type Output = T

Should always be Self
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.