pub struct SearchQuery {
pub pattern: Option<String>,
pub min_timestamp: Option<DateTime<Utc>>,
pub max_timestamp: Option<DateTime<Utc>>,
pub min_access_count: Option<u64>,
pub max_access_count: Option<u64>,
pub include_expired: bool,
pub category: Option<String>,
pub custom_predicates: Option<Value>,
}Expand description
Basic search query for cache entries
Fields§
§pattern: Option<String>Pattern to match in string representation
min_timestamp: Option<DateTime<Utc>>Minimum timestamp
max_timestamp: Option<DateTime<Utc>>Maximum timestamp
min_access_count: Option<u64>Minimum access count
max_access_count: Option<u64>Maximum access count
include_expired: boolInclude expired entries
category: Option<String>Category filter
custom_predicates: Option<Value>Custom predicates as JSON
Implementations§
Source§impl SearchQuery
impl SearchQuery
Sourcepub fn with_pattern<S: Into<String>>(self, pattern: S) -> Self
pub fn with_pattern<S: Into<String>>(self, pattern: S) -> Self
Set pattern to search for
Sourcepub fn with_timestamp_range(
self,
min: Option<DateTime<Utc>>,
max: Option<DateTime<Utc>>,
) -> Self
pub fn with_timestamp_range( self, min: Option<DateTime<Utc>>, max: Option<DateTime<Utc>>, ) -> Self
Set timestamp range
Sourcepub fn with_access_count_range(self, min: Option<u64>, max: Option<u64>) -> Self
pub fn with_access_count_range(self, min: Option<u64>, max: Option<u64>) -> Self
Set access count range
Sourcepub fn include_expired(self, include: bool) -> Self
pub fn include_expired(self, include: bool) -> Self
Set whether to include expired entries
Sourcepub fn with_category<S: Into<String>>(self, category: S) -> Self
pub fn with_category<S: Into<String>>(self, category: S) -> Self
Set category filter
Trait Implementations§
Source§impl Clone for SearchQuery
impl Clone for SearchQuery
Source§fn clone(&self) -> SearchQuery
fn clone(&self) -> SearchQuery
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SearchQuery
impl Debug for SearchQuery
Source§impl Default for SearchQuery
impl Default for SearchQuery
Source§fn default() -> SearchQuery
fn default() -> SearchQuery
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SearchQuery
impl<'de> Deserialize<'de> for SearchQuery
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SearchQuery
impl RefUnwindSafe for SearchQuery
impl Send for SearchQuery
impl Sync for SearchQuery
impl Unpin for SearchQuery
impl UnsafeUnpin for SearchQuery
impl UnwindSafe for SearchQuery
Blanket Implementations§
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
Mutably borrows from an owned value. Read more