Skip to main content

GraphProjection

Struct GraphProjection 

Source
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

Source

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

Source§

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>

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>

Returns a node by ID (latest visible version at current epoch).
Source§

fn get_edge(&self, id: EdgeId) -> Option<Edge>

Returns an edge by ID (latest visible version at current epoch).
Source§

fn get_node_versioned( &self, id: NodeId, epoch: EpochId, transaction_id: TransactionId, ) -> Option<Node>

Returns a node visible to a specific transaction.
Source§

fn get_node_at_epoch(&self, id: NodeId, epoch: EpochId) -> Option<Node>

Returns a node using pure epoch-based visibility (no transaction context). Read more
Source§

fn get_edge_at_epoch(&self, id: EdgeId, epoch: EpochId) -> Option<Edge>

Returns an edge using pure epoch-based visibility (no transaction context).
Source§

fn get_node_property(&self, id: NodeId, key: &PropertyKey) -> Option<Value>

Gets a single property from a node without loading all properties.
Source§

fn get_edge_property(&self, id: EdgeId, key: &PropertyKey) -> Option<Value>

Gets a single property from an edge without loading all properties.
Source§

fn get_node_property_batch( &self, ids: &[NodeId], key: &PropertyKey, ) -> Vec<Option<Value>>

Gets a property for multiple nodes in a single batch operation.
Source§

fn get_nodes_properties_batch( &self, ids: &[NodeId], ) -> Vec<FxHashMap<PropertyKey, Value>>

Gets all properties for multiple nodes in a single batch operation.
Source§

fn get_nodes_properties_selective_batch( &self, ids: &[NodeId], keys: &[PropertyKey], ) -> Vec<FxHashMap<PropertyKey, Value>>

Gets selected properties for multiple nodes (projection pushdown).
Source§

fn get_edges_properties_selective_batch( &self, ids: &[EdgeId], keys: &[PropertyKey], ) -> Vec<FxHashMap<PropertyKey, Value>>

Gets selected properties for multiple edges (projection pushdown).
Source§

fn neighbors(&self, node: NodeId, direction: Direction) -> Vec<NodeId>

Returns neighbor node IDs in the specified direction. Read more
Source§

fn edges_from( &self, node: NodeId, direction: Direction, ) -> Vec<(NodeId, EdgeId)>

Returns (target_node, edge_id) pairs for edges from a node.
Source§

fn out_degree(&self, node: NodeId) -> usize

Returns the out-degree of a node (number of outgoing edges).
Source§

fn in_degree(&self, node: NodeId) -> usize

Returns the in-degree of a node (number of incoming edges).
Source§

fn has_backward_adjacency(&self) -> bool

Whether backward adjacency is available for incoming edge queries.
Source§

fn node_ids(&self) -> Vec<NodeId>

Returns all non-deleted node IDs, sorted by ID.
Source§

fn all_node_ids(&self) -> Vec<NodeId>

Returns all node IDs including uncommitted/PENDING versions. Read more
Source§

fn nodes_by_label(&self, label: &str) -> Vec<NodeId>

Returns node IDs with a specific label.
Source§

fn node_count(&self) -> usize

Returns the total number of non-deleted nodes.
Source§

fn edge_count(&self) -> usize

Returns the total number of non-deleted edges.
Source§

fn edge_type(&self, id: EdgeId) -> Option<ArcStr>

Returns the type string of an edge.
Source§

fn has_property_index(&self, property: &str) -> bool

Returns true if a property index exists for the given property. Read more
Source§

fn find_nodes_by_property(&self, property: &str, value: &Value) -> Vec<NodeId>

Finds all nodes with a specific property value. Uses indexes when available.
Source§

fn find_nodes_by_properties(&self, conditions: &[(&str, Value)]) -> Vec<NodeId>

Finds nodes matching multiple property equality conditions.
Source§

fn find_nodes_in_range( &self, property: &str, min: Option<&Value>, max: Option<&Value>, min_inclusive: bool, max_inclusive: bool, ) -> Vec<NodeId>

Finds nodes whose property value falls within a range.
Source§

fn node_property_might_match( &self, property: &PropertyKey, op: CompareOp, value: &Value, ) -> bool

Returns 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

Returns true if an edge property predicate might match any edges.
Source§

fn statistics(&self) -> Arc<Statistics>

Returns the current statistics snapshot (cheap Arc clone).
Source§

fn estimate_label_cardinality(&self, label: &str) -> f64

Estimates cardinality for a label scan.
Source§

fn estimate_avg_degree(&self, edge_type: &str, outgoing: bool) -> f64

Estimates average degree for an edge type.
Source§

fn current_epoch(&self) -> EpochId

Returns the current MVCC epoch.
Source§

fn all_labels(&self) -> Vec<String>

Returns all label names in the database.
Source§

fn all_edge_types(&self) -> Vec<String>

Returns all edge type names in the database.
Source§

fn all_property_keys(&self) -> Vec<String>

Returns all property key names used in the database.
Source§

fn is_node_visible_at_epoch(&self, id: NodeId, epoch: EpochId) -> bool

Checks if a node is visible at the given epoch without building the full Node. Read more
Source§

fn is_node_visible_versioned( &self, id: NodeId, epoch: EpochId, transaction_id: TransactionId, ) -> bool

Checks if a node is visible to a specific transaction without building the full Node.
Source§

fn is_edge_visible_at_epoch(&self, id: EdgeId, epoch: EpochId) -> bool

Checks if an edge is visible at the given epoch without building the full Edge. Read more
Source§

fn is_edge_visible_versioned( &self, id: EdgeId, epoch: EpochId, transaction_id: TransactionId, ) -> bool

Checks if an edge is visible to a specific transaction without building the full Edge.
Source§

fn filter_visible_node_ids(&self, ids: &[NodeId], epoch: EpochId) -> Vec<NodeId>

Filters node IDs to only those visible at the given epoch (batch). Read more
Source§

fn filter_visible_node_ids_versioned( &self, ids: &[NodeId], epoch: EpochId, transaction_id: TransactionId, ) -> Vec<NodeId>

Filters node IDs to only those visible to a transaction (batch).
Source§

fn get_node_history(&self, _id: NodeId) -> Vec<(EpochId, Option<EpochId>, Node)>

Returns all versions of a node with their creation/deletion epochs, newest first. Read more
Source§

fn get_edge_history(&self, _id: EdgeId) -> Vec<(EpochId, Option<EpochId>, Edge)>

Returns all versions of an edge with their creation/deletion epochs, newest first. Read more
Source§

impl GraphStoreSearch for GraphProjection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.