pub struct GraphProjection { /* private fields */ }Expand description
A projected view of a graph
Projections are lightweight copies optimized for algorithm execution. They don’t modify the original graph.
Implementations§
Source§impl GraphProjection
impl GraphProjection
Sourcepub fn native(
graph: &GraphStore,
node_filter: NodeFilter,
edge_filter: EdgeFilter,
property_projection: PropertyProjection,
aggregation: AggregationStrategy,
) -> Self
pub fn native( graph: &GraphStore, node_filter: NodeFilter, edge_filter: EdgeFilter, property_projection: PropertyProjection, aggregation: AggregationStrategy, ) -> Self
Create a native projection from a graph with filters
Sourcepub fn from_nodes(graph: &GraphStore, node_ids: &[String]) -> Self
pub fn from_nodes(graph: &GraphStore, node_ids: &[String]) -> Self
Create a projection from a list of node IDs (induced subgraph)
Sourcepub fn from_paths(graph: &GraphStore, paths: &[Vec<String>]) -> Self
pub fn from_paths(graph: &GraphStore, paths: &[Vec<String>]) -> Self
Create a projection from traversal path results
Sourcepub fn undirected(
graph: &GraphStore,
node_filter: NodeFilter,
edge_filter: EdgeFilter,
) -> Self
pub fn undirected( graph: &GraphStore, node_filter: NodeFilter, edge_filter: EdgeFilter, ) -> Self
Create an undirected projection (each edge becomes bidirectional)
Sourcepub fn stats(&self) -> &ProjectionStats
pub fn stats(&self) -> &ProjectionStats
Get projection statistics
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get number of nodes
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get number of edges
Sourcepub fn get_node(&self, id: &str) -> Option<&ProjectedNode>
pub fn get_node(&self, id: &str) -> Option<&ProjectedNode>
Get a node by ID
Sourcepub fn iter_nodes(&self) -> impl Iterator<Item = &ProjectedNode>
pub fn iter_nodes(&self) -> impl Iterator<Item = &ProjectedNode>
Iterate over all nodes
Sourcepub fn outgoing(&self, node_id: &str) -> &[(String, String, f32)]
pub fn outgoing(&self, node_id: &str) -> &[(String, String, f32)]
Get outgoing edges from a node (target_id, edge_label, weight).
Sourcepub fn incoming(&self, node_id: &str) -> &[(String, String, f32)]
pub fn incoming(&self, node_id: &str) -> &[(String, String, f32)]
Get incoming edges to a node (source_id, edge_label, weight).
Sourcepub fn out_degree(&self, node_id: &str) -> usize
pub fn out_degree(&self, node_id: &str) -> usize
Get out-degree of a node
Sourcepub fn all_neighbors(&self, node_id: &str) -> HashSet<&str>
pub fn all_neighbors(&self, node_id: &str) -> HashSet<&str>
Get all neighbors (both directions)
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
Mutably borrows from an owned value. Read more
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 moreSource§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>
Wrap the input message
T in a tonic::Request