pub struct GraphFilter { /* private fields */ }Expand description
Allow-list or block-list of encoded graph names for a scan RPC.
Members are stored as a set: named-graph IRIs in a StrHashSet,
EncodedTerm::DefaultGraph as a flag, and blank (or other) graphs in a
small extras vec. exclude is the polarity of the whole filter, not a
per-term flag: false = allow-list (keep members), true = block-list
(keep non-members). The wire slice is built only in Self::terms /
Self::to_wire, sorted, and cached on this Arc so path hops of the
same filter do not rebuild it.
Compute still builds these as SPARQL windows (FROM NAMED allow-lists,
GRAPH ?g block-list of RDF DefaultGraph). The wire flag is inverted:
Self::wire_allow is proto graph_filter_allow (false = block-list).
Implementations§
Source§impl GraphFilter
impl GraphFilter
Sourcepub fn same_allocation(&self, other: &Self) -> bool
pub fn same_allocation(&self, other: &Self) -> bool
Whether two filters are the SAME window allocation. Scope-dedup consumers (the text planner’s sibling-stamp tracking) need soundness only — never-equal-when-different — and the lowering clones one allocation per window, so pointer identity is the practical equality: two structurally equal filters from different allocations read as distinct, which costs duplicate candidate arms that the union’s Distinct folds, never a wrong answer.
Sourcepub fn allow(terms: impl AsRef<[EncodedTerm]>) -> Self
pub fn allow(terms: impl AsRef<[EncodedTerm]>) -> Self
Allow-list of terms. Empty means an empty graph window (no rows).
Sourcepub fn empty_allow() -> Self
pub fn empty_allow() -> Self
Empty allow-list: residual G matches nothing (skip the scan RPC).
Sourcepub fn exclude(terms: impl AsRef<[EncodedTerm]>) -> Self
pub fn exclude(terms: impl AsRef<[EncodedTerm]>) -> Self
Block-list of terms. Empty means block nothing (no extra G constraint).
Sourcepub fn exclude_default() -> Self
pub fn exclude_default() -> Self
Named-graph-only scans: block the RDF unnamed graph.
Sourcepub fn is_exclude(&self) -> bool
pub fn is_exclude(&self) -> bool
true if this filter is a block-list.
Sourcepub fn is_empty_allow(&self) -> bool
pub fn is_empty_allow(&self) -> bool
Allow-list with no members: the empty graph window.
Sourcepub fn wire_allow(&self) -> bool
pub fn wire_allow(&self) -> bool
Wire graph_filter_allow: true for allow-lists, false for block-lists.
Sourcepub fn terms(&self) -> &[EncodedTerm]
pub fn terms(&self) -> &[EncodedTerm]
Sorted members for the scan / path-hop RPC. Cached on this Arc.
Sourcepub fn terms_arc(&self) -> Arc<[EncodedTerm]>
pub fn terms_arc(&self) -> Arc<[EncodedTerm]>
Self::terms as a cheap Arc clone (path PushedKeyVals, VALUES rows).
Sourcepub fn contains_member(&self, graph: &EncodedTerm) -> bool
pub fn contains_member(&self, graph: &EncodedTerm) -> bool
Whether graph is a member of the set (ignores polarity).
Sourcepub fn allows(&self, graph: &EncodedTerm) -> bool
pub fn allows(&self, graph: &EncodedTerm) -> bool
Whether graph survives this filter.
Empty allow-list: no graph. Empty block-list: every graph. Allow-list keeps members; block-list keeps non-members.
Sourcepub fn to_wire(filter: Option<&Self>) -> (&[EncodedTerm], bool)
pub fn to_wire(filter: Option<&Self>) -> (&[EncodedTerm], bool)
Map a plan-side filter onto the scan RPC.
None is an empty block-list (block nothing). Empty allow-lists stay
allow-lists so a missed skip-RPC cannot become a full scan.
Trait Implementations§
Source§impl Clone for GraphFilter
impl Clone for GraphFilter
Source§fn clone(&self) -> GraphFilter
fn clone(&self) -> GraphFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphFilter
impl Debug for GraphFilter
Source§impl PartialEq for GraphFilter
impl PartialEq for GraphFilter
impl Eq for GraphFilter
Auto Trait Implementations§
impl Freeze for GraphFilter
impl RefUnwindSafe for GraphFilter
impl Send for GraphFilter
impl Sync for GraphFilter
impl Unpin for GraphFilter
impl UnsafeUnpin for GraphFilter
impl UnwindSafe for GraphFilter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].