Skip to main content

FilterOp

Enum FilterOp 

Source
pub enum FilterOp {
Show 21 variants Eq, EqOrMissing, EqOrMissingIndexed, JsonTypeMissing, JsonTypeMissingOrNullIndexed, EqOrLegacyIndexed, TextEqOrNonText, TextInOrNonText(Vec<SqlValue>), Ne, Lt, Lte, Gt, Gte, JsonTypeEq, JsonTypeNeMissing, In(Vec<SqlValue>), NotInOrMissing(Vec<SqlValue>), TextStartsWithIndexed, Rfc3339Valid, Rfc3339Gte, Rfc3339Lte,
}
Expand description

Comparison operator for a PropertyFilter on a JSON path.

Variants§

§

Eq

§

EqOrMissing

Matches rows where the JSON field equals the value OR the field is absent/NULL. Used for properties that may be missing in legacy rows (e.g. $.read).

§

EqOrMissingIndexed

Matches the supplied value using the indexable ifnull(json_extract(...), '') expression. The value may be any SqlValue accepted by the SQL adapter; in particular, Text("") matches both missing values and present-but-empty values.

§

JsonTypeMissing

Matches rows where the JSON field is absent or SQL-NULL.

§

JsonTypeMissingOrNullIndexed

Matches rows where the JSON field is absent or explicitly JSON null, while constraining its index key to the empty recipient key. This is the index-friendly legacy-recipient partition used with FilterOp::EqOrMissingIndexed.

§

EqOrLegacyIndexed

Combines the exact-value and legacy-recipient partitions (EqOrMissingIndexed + JsonTypeMissingOrNullIndexed) into one predicate over the same indexable ifnull(json_extract(...), '') expression, so a single index seek serves both partitions instead of two separate bounded queries. Matches rows where the field equals the value, OR the field is absent/JSON-null. A present-but-empty JSON string value does NOT match through the legacy branch — the same json_type guard JsonTypeMissingOrNullIndexed uses excludes it — so this reproduces EqOrMissing exactly, given a non-empty compared value.

§

TextEqOrNonText

Matches rows where a JSON text field equals the value, while treating every missing or non-text value as that same value. The SQL adapter emits CASE WHEN json_type(...) = 'text' THEN json_extract(...) ELSE value END = value, mirroring callers whose read model assigns one textual default to absent, JSON-null, and malformed legacy values.

§

TextInOrNonText(Vec<SqlValue>)

Matches a JSON text field against the supplied set, or any missing or non-text value. The non-text branch still matches when the set is empty. PropertyFilter.value is unused; the set lives in this variant.

§

Ne

§

Lt

§

Lte

§

Gt

§

Gte

§

JsonTypeEq

Matches rows where json_type(properties, path) = value. Value must be a SQLite json_type string literal: ‘true’, ‘false’, ‘integer’, ‘real’, ‘text’, ‘array’, ‘object’, or ‘null’.

§

JsonTypeNeMissing

Matches rows where the json_type is absent (NULL) OR differs from value. Equivalent to json_type IS NULL OR json_type != value. Value must be a SQLite json_type string literal: ‘true’, ‘false’, ‘integer’, ‘real’, ‘text’, ‘array’, ‘object’, or ‘null’. Used for unread filter: matches any $.read that is NOT the JSON boolean true.

§

In(Vec<SqlValue>)

Matches rows where json_extract(properties, path) equals any value in the set. A row with a missing/NULL property does not match — use TextInOrNonText when a textual read model includes missing/non-text legacy values. PropertyFilter.value is unused for this op; the set lives in the variant itself.

§

NotInOrMissing(Vec<SqlValue>)

Matches rows where the property is missing/NULL OR its value is not in the set. Used to exclude a closed set while treating an unset property as included (e.g. comm inbox excludes outbound). PropertyFilter.value is unused for this op; the set lives in the variant itself.

§

TextStartsWithIndexed

Matches rows whose JSON text field starts with the supplied prefix. Rendered as an index-seekable half-open range over the plain json_extract expression (expr >= prefix AND expr < next(prefix), where next increments the prefix’s last code point), so an index keyed on that expression serves the seek instead of a scan. SQLite sorts non-text values outside the text range, so a missing, null or numeric field never matches. PropertyFilter.value is the prefix and must be SqlValue::Text; an empty prefix matches every text value.

§

Rfc3339Valid

Keep only RFC 3339 text values that parse as UTC instants.

§

Rfc3339Gte

Compare parsed UTC instants, including subsecond precision and offsets. The value is a Timestamp or RFC 3339 Text.

§

Rfc3339Lte

Trait Implementations§

Source§

impl Clone for FilterOp

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 FilterOp

Source§

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

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

impl<'de> Deserialize<'de> for FilterOp

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 Serialize for FilterOp

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

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> 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.