pub struct ReadSnapshot { /* private fields */ }Implementations§
Source§impl ReadSnapshot
impl ReadSnapshot
Sourcepub fn read_graph_json(&self) -> String
pub fn read_graph_json(&self) -> String
Serialize the full graph directly to a JSON string, avoiding intermediate
owned Entity/Relation allocations. This is the fast path for handlers.
Sourcepub fn read_graph_view(&self) -> ReadGraphView<'_>
pub fn read_graph_view(&self) -> ReadGraphView<'_>
Borrowing view of the full graph, suitable for serde-serialization without intermediate owned String allocations.
Sourcepub fn open_nodes(&self, names: &[String]) -> KnowledgeGraphOut
pub fn open_nodes(&self, names: &[String]) -> KnowledgeGraphOut
Open named entities + incident relations.
Sourcepub fn read_graph(&self) -> KnowledgeGraphOut
pub fn read_graph(&self) -> KnowledgeGraphOut
Full graph read. Returns all entities and relations.
Sourcepub fn get_entity(&self, name: &str) -> Option<Entity>
pub fn get_entity(&self, name: &str) -> Option<Entity>
Get a single entity by name.
Sourcepub fn neighbors(
&self,
name: &str,
direction: Direction,
rtype: Option<&str>,
depth: u32,
) -> Result<KnowledgeGraphOut>
pub fn neighbors( &self, name: &str, direction: Direction, rtype: Option<&str>, depth: u32, ) -> Result<KnowledgeGraphOut>
Neighborhood expansion (same logic as KnowledgeGraph::neighbors but read-only).
Sourcepub fn describe_entity(&self, name: &str) -> Result<Value>
pub fn describe_entity(&self, name: &str) -> Result<Value>
Describe an entity: entity details, incident relations, neighbors, degree.
Sourcepub fn find_path(&self, from: &str, to: &str) -> Result<Vec<String>>
pub fn find_path(&self, from: &str, to: &str) -> Result<Vec<String>>
Find the shortest path between two entities.
Sourcepub fn extract_subgraph(
&self,
names: &[String],
depth: u32,
) -> Result<KnowledgeGraphOut>
pub fn extract_subgraph( &self, names: &[String], depth: u32, ) -> Result<KnowledgeGraphOut>
Extract a subgraph around the given entities.
Sourcepub fn graph_stats(&self) -> Value
pub fn graph_stats(&self) -> Value
Graph statistics.
Sourcepub fn search_relations(
&self,
from: Option<&str>,
to: Option<&str>,
rtype: Option<&str>,
) -> Vec<Relation>
pub fn search_relations( &self, from: Option<&str>, to: Option<&str>, rtype: Option<&str>, ) -> Vec<Relation>
Search relations by from/to/type filters.
Sourcepub fn entity_type_counts(&self) -> Vec<(String, usize)>
pub fn entity_type_counts(&self) -> Vec<(String, usize)>
Count entities per type.
Sourcepub fn relation_type_counts(&self) -> Vec<(String, usize)>
pub fn relation_type_counts(&self) -> Vec<(String, usize)>
Count relations per type.
Sourcepub fn export(&self, format: &str) -> Result<String>
pub fn export(&self, format: &str) -> Result<String>
Export the graph in one of: json, mermaid, dot.
Trait Implementations§
Source§impl Clone for ReadSnapshot
impl Clone for ReadSnapshot
Source§fn clone(&self) -> ReadSnapshot
fn clone(&self) -> ReadSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more