pub struct ScanFilter {
pub field: String,
pub op: FilterOp,
pub value: Value,
pub clauses: Vec<Vec<ScanFilter>>,
}Expand description
A single filter predicate for document scan evaluation.
Supports simple comparison operators (eq, ne, gt, gte, lt, lte, contains,
is_null, is_not_null) and disjunctive groups via the "or" operator.
OR representation: {"op": "or", "clauses": [[filter1, filter2], [filter3]]}
means (filter1 AND filter2) OR filter3. Each clause is an AND-group;
the document matches if ANY clause group fully matches.
Fields§
§field: String§op: FilterOp§value: Value§clauses: Vec<Vec<ScanFilter>>Disjunctive clause groups for OR predicates. Each inner Vec is an AND-group. The document matches if ANY group matches.
Implementations§
Source§impl ScanFilter
impl ScanFilter
Sourcepub fn matches_binary(&self, doc: &[u8]) -> bool
pub fn matches_binary(&self, doc: &[u8]) -> bool
Evaluate this filter against a raw MessagePack document.
Zero deserialization — extracts only the needed field bytes.
Sourcepub fn matches_binary_indexed(&self, doc: &[u8], idx: &FieldIndex) -> bool
pub fn matches_binary_indexed(&self, doc: &[u8], idx: &FieldIndex) -> bool
Evaluate using a pre-built FieldIndex for O(1) field lookup.
Use when evaluating multiple predicates on the same document.
Source§impl ScanFilter
impl ScanFilter
Sourcepub fn matches_value(&self, doc: &Value) -> bool
pub fn matches_value(&self, doc: &Value) -> bool
Evaluate this filter against a nodedb_types::Value document.
Same semantics as matches() but operates on the native Value type
instead of serde_json::Value, avoiding lossy JSON roundtrips.
Trait Implementations§
Source§impl Clone for ScanFilter
impl Clone for ScanFilter
Source§fn clone(&self) -> ScanFilter
fn clone(&self) -> ScanFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ScanFilter
impl Default for ScanFilter
Source§fn default() -> ScanFilter
fn default() -> ScanFilter
Source§impl<'de> Deserialize<'de> for ScanFilter
impl<'de> Deserialize<'de> for ScanFilter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'a> FromMessagePack<'a> for ScanFilter
impl<'a> FromMessagePack<'a> for ScanFilter
Source§impl Serialize for ScanFilter
impl Serialize for ScanFilter
Auto Trait Implementations§
impl Freeze for ScanFilter
impl RefUnwindSafe for ScanFilter
impl Send for ScanFilter
impl Sync for ScanFilter
impl Unpin for ScanFilter
impl UnsafeUnpin for ScanFilter
impl UnwindSafe for ScanFilter
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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>
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>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.