pub struct GraphProjection { /* private fields */ }Expand description
A read-only, filtered view of a graph store.
Delegates all reads to the inner store, filtering results by the
ProjectionSpec. Nodes without matching labels and edges without
matching types are invisible.
Implementations§
Source§impl GraphProjection
impl GraphProjection
Sourcepub fn new(inner: Arc<dyn GraphStoreSearch>, spec: ProjectionSpec) -> Self
pub fn new(inner: Arc<dyn GraphStoreSearch>, spec: ProjectionSpec) -> Self
Creates a new projection over the given store.
Trait Implementations§
Source§impl GraphStore for GraphProjection
impl GraphStore for GraphProjection
Source§fn get_edge_versioned(
&self,
id: EdgeId,
epoch: EpochId,
transaction_id: TransactionId,
) -> Option<Edge>
fn get_edge_versioned( &self, id: EdgeId, epoch: EpochId, transaction_id: TransactionId, ) -> Option<Edge>
Returns a versioned edge if it passes projection filters.
Limitation: edge_matches checks endpoint visibility via get_node
(current snapshot), not get_node_versioned, because GraphProjection
does not store epoch/transaction context. This means endpoint filtering
may reflect the current state rather than the requested version.
Source§fn edge_type_versioned(
&self,
id: EdgeId,
epoch: EpochId,
transaction_id: TransactionId,
) -> Option<ArcStr>
fn edge_type_versioned( &self, id: EdgeId, epoch: EpochId, transaction_id: TransactionId, ) -> Option<ArcStr>
Returns the type of a versioned edge if it passes projection filters.
Limitation: endpoint visibility is checked via get_node (current
snapshot), not get_node_versioned. See get_edge_versioned for details.
Source§fn get_node(&self, id: NodeId) -> Option<Node>
fn get_node(&self, id: NodeId) -> Option<Node>
Source§fn get_edge(&self, id: EdgeId) -> Option<Edge>
fn get_edge(&self, id: EdgeId) -> Option<Edge>
Source§fn get_node_versioned(
&self,
id: NodeId,
epoch: EpochId,
transaction_id: TransactionId,
) -> Option<Node>
fn get_node_versioned( &self, id: NodeId, epoch: EpochId, transaction_id: TransactionId, ) -> Option<Node>
Source§fn get_node_at_epoch(&self, id: NodeId, epoch: EpochId) -> Option<Node>
fn get_node_at_epoch(&self, id: NodeId, epoch: EpochId) -> Option<Node>
Source§fn get_edge_at_epoch(&self, id: EdgeId, epoch: EpochId) -> Option<Edge>
fn get_edge_at_epoch(&self, id: EdgeId, epoch: EpochId) -> Option<Edge>
Source§fn get_node_property(&self, id: NodeId, key: &PropertyKey) -> Option<Value>
fn get_node_property(&self, id: NodeId, key: &PropertyKey) -> Option<Value>
Source§fn get_edge_property(&self, id: EdgeId, key: &PropertyKey) -> Option<Value>
fn get_edge_property(&self, id: EdgeId, key: &PropertyKey) -> Option<Value>
Source§fn get_node_property_batch(
&self,
ids: &[NodeId],
key: &PropertyKey,
) -> Vec<Option<Value>>
fn get_node_property_batch( &self, ids: &[NodeId], key: &PropertyKey, ) -> Vec<Option<Value>>
Source§fn get_nodes_properties_batch(
&self,
ids: &[NodeId],
) -> Vec<FxHashMap<PropertyKey, Value>> ⓘ
fn get_nodes_properties_batch( &self, ids: &[NodeId], ) -> Vec<FxHashMap<PropertyKey, Value>> ⓘ
Source§fn get_nodes_properties_selective_batch(
&self,
ids: &[NodeId],
keys: &[PropertyKey],
) -> Vec<FxHashMap<PropertyKey, Value>> ⓘ
fn get_nodes_properties_selective_batch( &self, ids: &[NodeId], keys: &[PropertyKey], ) -> Vec<FxHashMap<PropertyKey, Value>> ⓘ
Source§fn get_edges_properties_selective_batch(
&self,
ids: &[EdgeId],
keys: &[PropertyKey],
) -> Vec<FxHashMap<PropertyKey, Value>> ⓘ
fn get_edges_properties_selective_batch( &self, ids: &[EdgeId], keys: &[PropertyKey], ) -> Vec<FxHashMap<PropertyKey, Value>> ⓘ
Source§fn neighbors(&self, node: NodeId, direction: Direction) -> Vec<NodeId>
fn neighbors(&self, node: NodeId, direction: Direction) -> Vec<NodeId>
Source§fn edges_from(
&self,
node: NodeId,
direction: Direction,
) -> Vec<(NodeId, EdgeId)>
fn edges_from( &self, node: NodeId, direction: Direction, ) -> Vec<(NodeId, EdgeId)>
Source§fn out_degree(&self, node: NodeId) -> usize
fn out_degree(&self, node: NodeId) -> usize
Source§fn in_degree(&self, node: NodeId) -> usize
fn in_degree(&self, node: NodeId) -> usize
Source§fn has_backward_adjacency(&self) -> bool
fn has_backward_adjacency(&self) -> bool
Source§fn all_node_ids(&self) -> Vec<NodeId>
fn all_node_ids(&self) -> Vec<NodeId>
Source§fn node_count(&self) -> usize
fn node_count(&self) -> usize
Source§fn edge_count(&self) -> usize
fn edge_count(&self) -> usize
Source§fn has_property_index(&self, property: &str) -> bool
fn has_property_index(&self, property: &str) -> bool
true if a property index exists for the given property. Read moreSource§fn find_nodes_by_property(&self, property: &str, value: &Value) -> Vec<NodeId>
fn find_nodes_by_property(&self, property: &str, value: &Value) -> Vec<NodeId>
Source§fn find_nodes_by_properties(&self, conditions: &[(&str, Value)]) -> Vec<NodeId>
fn find_nodes_by_properties(&self, conditions: &[(&str, Value)]) -> Vec<NodeId>
Source§fn find_nodes_in_range(
&self,
property: &str,
min: Option<&Value>,
max: Option<&Value>,
min_inclusive: bool,
max_inclusive: bool,
) -> Vec<NodeId>
fn find_nodes_in_range( &self, property: &str, min: Option<&Value>, max: Option<&Value>, min_inclusive: bool, max_inclusive: bool, ) -> Vec<NodeId>
Source§fn node_property_might_match(
&self,
property: &PropertyKey,
op: CompareOp,
value: &Value,
) -> bool
fn node_property_might_match( &self, property: &PropertyKey, op: CompareOp, value: &Value, ) -> bool
true if a node property predicate might match any nodes.
Uses zone maps for early filtering.Source§fn edge_property_might_match(
&self,
property: &PropertyKey,
op: CompareOp,
value: &Value,
) -> bool
fn edge_property_might_match( &self, property: &PropertyKey, op: CompareOp, value: &Value, ) -> bool
true if an edge property predicate might match any edges.Source§fn statistics(&self) -> Arc<Statistics>
fn statistics(&self) -> Arc<Statistics>
Source§fn estimate_label_cardinality(&self, label: &str) -> f64
fn estimate_label_cardinality(&self, label: &str) -> f64
Source§fn estimate_avg_degree(&self, edge_type: &str, outgoing: bool) -> f64
fn estimate_avg_degree(&self, edge_type: &str, outgoing: bool) -> f64
Source§fn current_epoch(&self) -> EpochId
fn current_epoch(&self) -> EpochId
Source§fn all_labels(&self) -> Vec<String>
fn all_labels(&self) -> Vec<String>
Source§fn all_edge_types(&self) -> Vec<String>
fn all_edge_types(&self) -> Vec<String>
Source§fn all_property_keys(&self) -> Vec<String>
fn all_property_keys(&self) -> Vec<String>
Source§fn is_node_visible_at_epoch(&self, id: NodeId, epoch: EpochId) -> bool
fn is_node_visible_at_epoch(&self, id: NodeId, epoch: EpochId) -> bool
Source§fn is_node_visible_versioned(
&self,
id: NodeId,
epoch: EpochId,
transaction_id: TransactionId,
) -> bool
fn is_node_visible_versioned( &self, id: NodeId, epoch: EpochId, transaction_id: TransactionId, ) -> bool
Source§fn is_edge_visible_at_epoch(&self, id: EdgeId, epoch: EpochId) -> bool
fn is_edge_visible_at_epoch(&self, id: EdgeId, epoch: EpochId) -> bool
Source§fn is_edge_visible_versioned(
&self,
id: EdgeId,
epoch: EpochId,
transaction_id: TransactionId,
) -> bool
fn is_edge_visible_versioned( &self, id: EdgeId, epoch: EpochId, transaction_id: TransactionId, ) -> bool
Source§fn filter_visible_node_ids(&self, ids: &[NodeId], epoch: EpochId) -> Vec<NodeId>
fn filter_visible_node_ids(&self, ids: &[NodeId], epoch: EpochId) -> Vec<NodeId>
Source§fn filter_visible_node_ids_versioned(
&self,
ids: &[NodeId],
epoch: EpochId,
transaction_id: TransactionId,
) -> Vec<NodeId>
fn filter_visible_node_ids_versioned( &self, ids: &[NodeId], epoch: EpochId, transaction_id: TransactionId, ) -> Vec<NodeId>
impl GraphStoreSearch for GraphProjection
Auto Trait Implementations§
impl Freeze for GraphProjection
impl !RefUnwindSafe for GraphProjection
impl Send for GraphProjection
impl Sync for GraphProjection
impl Unpin for GraphProjection
impl UnsafeUnpin for GraphProjection
impl !UnwindSafe for GraphProjection
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> 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>
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>
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