pub struct NoteFilter {Show 18 fields
pub kind: Option<String>,
pub property_filters: Vec<PropertyFilter>,
pub order_by: Option<(String, SortDir)>,
pub order_by_instant: bool,
pub unordered: bool,
pub namespaces: Vec<String>,
pub min_created_at: Option<i64>,
pub max_created_at: Option<i64>,
pub max_expires_at: Option<i64>,
pub include_deleted: bool,
pub expiry_fallback: Option<NoteExpiryFallback>,
pub time_order: Option<NoteTimeOrder>,
pub min_updated_at: Option<i64>,
pub tags: Vec<String>,
pub tag_mode: NoteTagMode,
pub after: Option<NoteSeekAfter>,
pub after_instant: Option<NoteInstantSeekAfter>,
pub mailbox: Option<NoteMailboxScope>,
}Expand description
Filter + sort options for NoteStore::query_notes_filtered.
Designed for general property-based filtering on any JSON field, not schedule-specific, so D9 and future packs can reuse the same API.
Fields§
§kind: Option<String>§property_filters: Vec<PropertyFilter>§order_by: Option<(String, SortDir)>(json_path, direction) — None defaults to created_at DESC.
order_by_instant: boolInterpret order_by’s text property as an RFC 3339 UTC instant before
sorting. Only ascending order is currently supported.
unordered: boolWhen true, omit the SQL ordering clause from count-free pages. The caller is responsible for ordering the bounded result set.
namespaces: Vec<String>When non-empty, restricts results to any of these namespaces using
namespace IN (...). Takes precedence over the namespace string
parameter passed to query_notes_filtered. When empty the
caller-supplied namespace parameter is used (backward-compatible).
min_created_at: Option<i64>Restrict to notes where created_at >= min_created_at (microseconds epoch).
None applies no lower-bound constraint.
max_created_at: Option<i64>Inclusive creation-time upper bound in microseconds since the Unix epoch.
max_expires_at: Option<i64>Inclusive expiry-time upper bound in microseconds since the Unix epoch. Rows with no expiry do not match a supplied bound.
include_deleted: boolInclude soft-deleted rows in filtered reads. Property patches remain live-only.
expiry_fallback: Option<NoteExpiryFallback>Select expired notes, falling back to creation time only when expiry is absent. This predicate is ANDed with all other bounds and property filters.
time_order: Option<NoteTimeOrder>Native ascending timestamp order for counted/count-free/bounded pages. Incompatible with property/instant/unordered ordering or any cursor. Keyed/sequence reads and filtered mutations reject it; counts ignore ordering.
min_updated_at: Option<i64>§tag_mode: NoteTagMode§after: Option<NoteSeekAfter>Restrict results to rows strictly after this boundary in the default
created_at DESC, id ASC order, for keyset (seek) pagination that
avoids re-walking earlier pages the way PageRequest.offset does.
Requires order_by to be None.
Honoured only by NoteStore::query_notes_filtered_count_free, which
seeks directly to the boundary and returns total: None.
NoteStore::query_notes_filtered rejects a non-None value with
StorageError::InvalidInput: it computes an exact COUNT(*) total
over the whole matching set, which has no defined meaning paired with
a seek boundary.
after_instant: Option<NoteInstantSeekAfter>Seek after a row in the order_by_instant total order. Honoured only
by query_notes_filtered_count_free with offset: 0.
mailbox: Option<NoteMailboxScope>Restrict message rows to the ones this mailbox reader may see, in
the query itself. Rows of every other kind are unaffected. Applying the
partition here means a scan window, and any cursor derived from it,
only ever contains rows the reader is allowed to see.
Implementations§
Source§impl NoteFilter
impl NoteFilter
Sourcepub fn expires_before(self, micros: i64) -> Self
pub fn expires_before(self, micros: i64) -> Self
Select expiry timestamps at or before micros (inclusive, Unix microseconds).
A note without an expiry does not match this bound.
Sourcepub fn created_before(self, micros: i64) -> Self
pub fn created_before(self, micros: i64) -> Self
Select creation timestamps at or before micros (inclusive, Unix microseconds).
Sourcepub fn include_deleted(self) -> Self
pub fn include_deleted(self) -> Self
Include tombstones in filtered reads without permitting property patches on them.