pub struct ContextQuery {
pub query: Option<String>,
pub domain_filter: Option<ContextDomain>,
pub tag_filter: Option<Vec<String>>,
pub source_filter: Option<String>,
pub min_importance: Option<f32>,
pub max_age_seconds: Option<i64>,
pub verified_only: bool,
pub limit: usize,
}Expand description
Builder for creating context queries
Fields§
§query: Option<String>Text query for similarity search
domain_filter: Option<ContextDomain>Filter by domain
tag_filter: Option<Vec<String>>Filter by tags (any match)
source_filter: Option<String>Filter by source
min_importance: Option<f32>Minimum importance threshold
max_age_seconds: Option<i64>Maximum age in seconds
verified_only: boolOnly return verified/screened context
limit: usizeMaximum results to return
Implementations§
Source§impl ContextQuery
impl ContextQuery
pub fn new() -> Self
pub fn with_text(self, query: impl Into<String>) -> Self
pub fn with_domain(self, domain: ContextDomain) -> Self
pub fn with_min_importance(self, importance: f32) -> Self
pub fn with_max_age(self, seconds: i64) -> Self
pub fn with_max_age_hours(self, hours: i64) -> Self
pub fn with_tag(self, tag: String) -> Self
pub fn verified_only(self) -> Self
pub fn with_limit(self, limit: usize) -> Self
Trait Implementations§
Source§impl Clone for ContextQuery
impl Clone for ContextQuery
Source§fn clone(&self) -> ContextQuery
fn clone(&self) -> ContextQuery
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 ContextQuery
impl Debug for ContextQuery
Source§impl Default for ContextQuery
impl Default for ContextQuery
Source§fn default() -> ContextQuery
fn default() -> ContextQuery
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ContextQuery
impl RefUnwindSafe for ContextQuery
impl Send for ContextQuery
impl Sync for ContextQuery
impl Unpin for ContextQuery
impl UnwindSafe for ContextQuery
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
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>
Converts
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>
Converts
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 more