Get a graph by name (read-only access)
(&self, name: &str)
| 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> { |