pub struct MemoryPredicate {
pub kinds: Option<Vec<ChunkKind>>,
pub callers: Option<Vec<String>>,
pub session_ids: Option<Vec<String>>,
pub project_root_prefix: Option<String>,
pub before: Option<DateTime<Utc>>,
pub after: Option<DateTime<Utc>>,
pub pinned: Option<bool>,
pub importance_below: Option<f32>,
pub content_contains: Option<String>,
}Expand description
Criteria for crate::MemoryProvider::delete_matching (and reused as the
filter inside crate::ExportFilter).
Empty predicate matches nothing — delete_matching(MemoryPredicate::default())
is a safe no-op rather than a “delete everything” footgun. Use
crate::MemoryProvider::purge_all for that.
Fields§
§kinds: Option<Vec<ChunkKind>>Match chunks whose kind is in this set.
callers: Option<Vec<String>>Match chunks written by callers in this set.
session_ids: Option<Vec<String>>Match chunks belonging to these sessions.
project_root_prefix: Option<String>Match chunks whose project_root begins with this prefix.
before: Option<DateTime<Utc>>Match chunks created before this instant.
after: Option<DateTime<Utc>>Match chunks created after this instant.
pinned: Option<bool>If Some(true), only pinned chunks; if Some(false), only unpinned;
None ignores pinning.
importance_below: Option<f32>Match chunks with importance strictly less than this.
content_contains: Option<String>Match chunks whose content contains this substring (case-insensitive in v1).
Implementations§
Source§impl MemoryPredicate
impl MemoryPredicate
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True if the predicate has no constraints — i.e. would match every
chunk. crate::MemoryProvider::delete_matching short-circuits to a
no-op when this returns true.
Trait Implementations§
Source§impl Clone for MemoryPredicate
impl Clone for MemoryPredicate
Source§fn clone(&self) -> MemoryPredicate
fn clone(&self) -> MemoryPredicate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryPredicate
impl Debug for MemoryPredicate
Source§impl Default for MemoryPredicate
impl Default for MemoryPredicate
Source§fn default() -> MemoryPredicate
fn default() -> MemoryPredicate
Source§impl<'de> Deserialize<'de> for MemoryPredicate
impl<'de> Deserialize<'de> for MemoryPredicate
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 PartialEq for MemoryPredicate
impl PartialEq for MemoryPredicate
Source§fn eq(&self, other: &MemoryPredicate) -> bool
fn eq(&self, other: &MemoryPredicate) -> bool
self and other values to be equal, and is used by ==.