pub struct RetrievalFilter {
pub document_sets: Option<Vec<String>>,
pub metadata_eq: HashMap<String, String>,
}Expand description
A query-time retrieval filter: scope results to named document sets and/or require metadata equalities.
document_sets: None⇒ no set scoping (every document is eligible — the current/default behavior).Some([])⇒ scope to no set (matches nothing);Some(["alpha"])⇒ only documents in set"alpha"; a doc in any of the listed sets matches (union).metadata_eq⇒ every(key, value)must be present and equal in the document’s stamped metadata (logical AND across the map). Empty ⇒ no metadata constraint.
An all-default RetrievalFilter (RetrievalFilter::none) matches every
document — the no-op that preserves current retrieval behavior.
Fields§
§document_sets: Option<Vec<String>>Scope to documents in any of these sets. None ⇒ unscoped (all docs).
metadata_eq: HashMap<String, String>Require these key == value metadata equalities (all must hold).
Implementations§
Source§impl RetrievalFilter
impl RetrievalFilter
Sourcepub fn none() -> Self
pub fn none() -> Self
The no-op filter: no set scoping, no metadata constraint — matches every document (preserves default retrieval behavior).
Sourcepub fn in_sets<I, S>(sets: I) -> Self
pub fn in_sets<I, S>(sets: I) -> Self
Scope retrieval to the given document sets (a doc in any of them matches).
Sourcepub fn with_metadata_eq(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata_eq( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a required metadata equality (builder).
Sourcepub fn is_unconstrained(&self) -> bool
pub fn is_unconstrained(&self) -> bool
Whether this filter imposes no constraint at all (so retrieval is unchanged). Used to short-circuit the over-fetch when there’s nothing to filter on.
Trait Implementations§
Source§impl Clone for RetrievalFilter
impl Clone for RetrievalFilter
Source§fn clone(&self) -> RetrievalFilter
fn clone(&self) -> RetrievalFilter
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 RetrievalFilter
impl Debug for RetrievalFilter
Source§impl Default for RetrievalFilter
impl Default for RetrievalFilter
Source§fn default() -> RetrievalFilter
fn default() -> RetrievalFilter
Source§impl<'de> Deserialize<'de> for RetrievalFilter
impl<'de> Deserialize<'de> for RetrievalFilter
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>,
impl Eq for RetrievalFilter
Source§impl PartialEq for RetrievalFilter
impl PartialEq for RetrievalFilter
Source§fn eq(&self, other: &RetrievalFilter) -> bool
fn eq(&self, other: &RetrievalFilter) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for RetrievalFilter
impl Serialize for RetrievalFilter
impl StructuralPartialEq for RetrievalFilter
Auto Trait Implementations§
impl Freeze for RetrievalFilter
impl RefUnwindSafe for RetrievalFilter
impl Send for RetrievalFilter
impl Sync for RetrievalFilter
impl Unpin for RetrievalFilter
impl UnsafeUnpin for RetrievalFilter
impl UnwindSafe for RetrievalFilter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FromResponse for Twhere
T: DeserializeOwned,
impl<T> FromResponse for Twhere
T: DeserializeOwned,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request