MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / get_graph

Method get_graph

graphlite/src/storage/multi_graph.rs:57–67  ·  view source on GitHub ↗

Get a graph by name (read-only access)

(&self, name: &str)

Source from the content-addressed store, hash-verified

55
56 /// Get a graph by name (read-only access)
57 pub fn get_graph(&self, name: &str) -> Result<Option<GraphCache>, StorageError> {
58 debug!("Getting graph: '{}' (key length: {})", name, name.len());
59
60 let graphs = self
61 .graphs
62 .read()
63 .map_err(|e| StorageError::LockError(format!("Failed to acquire read lock: {}", e)))?;
64
65 let result = graphs.get(name).cloned();
66 Ok(result)
67 }
68
69 /// Get a mutable reference to a graph
70 pub fn get_graph_mut(&self, name: &str) -> Result<Option<GraphCache>, StorageError> {

Callers 1

Calls 1

getMethod · 0.45

Tested by 1