Skip to main content

GraphStorage

Trait GraphStorage 

Source
pub trait GraphStorage {
Show 53 methods // Required methods fn all_nodes(&self) -> Vec<NodeRecord>; fn nodes_by_label(&self, label: &str) -> Vec<NodeRecord>; fn node_ref(&self, id: NodeId) -> Option<&NodeRecord>; fn all_relationships(&self) -> Vec<RelationshipRecord>; fn relationships_by_type(&self, rel_type: &str) -> Vec<RelationshipRecord>; fn relationship_ref( &self, id: RelationshipId, ) -> Option<&RelationshipRecord>; fn outgoing_relationships(&self, node_id: NodeId) -> Vec<RelationshipRecord>; fn incoming_relationships(&self, node_id: NodeId) -> Vec<RelationshipRecord>; // Provided methods fn node(&self, id: NodeId) -> Option<NodeRecord> { ... } fn has_node(&self, id: NodeId) -> bool { ... } fn node_count(&self) -> usize { ... } fn all_node_ids(&self) -> Vec<NodeId> { ... } fn node_ids_by_label(&self, label: &str) -> Vec<NodeId> { ... } fn relationship(&self, id: RelationshipId) -> Option<RelationshipRecord> { ... } fn has_relationship(&self, id: RelationshipId) -> bool { ... } fn relationship_count(&self) -> usize { ... } fn all_rel_ids(&self) -> Vec<RelationshipId> { ... } fn rel_ids_by_type(&self, rel_type: &str) -> Vec<RelationshipId> { ... } fn all_labels(&self) -> Vec<String> { ... } fn all_relationship_types(&self) -> Vec<String> { ... } fn all_node_property_keys(&self) -> Vec<String> { ... } fn all_relationship_property_keys(&self) -> Vec<String> { ... } fn all_property_keys(&self) -> Vec<String> { ... } fn label_property_keys(&self, label: &str) -> Vec<String> { ... } fn rel_type_property_keys(&self, rel_type: &str) -> Vec<String> { ... } fn has_label_name(&self, label: &str) -> bool { ... } fn has_relationship_type_name(&self, rel_type: &str) -> bool { ... } fn has_property_key(&self, key: &str) -> bool { ... } fn label_has_property_key(&self, label: &str, key: &str) -> bool { ... } fn rel_type_has_property_key(&self, rel_type: &str, key: &str) -> bool { ... } fn node_has_label(&self, node_id: NodeId, label: &str) -> bool { ... } fn node_labels(&self, node_id: NodeId) -> Option<Vec<String>> { ... } fn node_properties(&self, node_id: NodeId) -> Option<Properties> { ... } fn node_property(&self, node_id: NodeId, key: &str) -> Option<PropertyValue> { ... } fn relationship_type(&self, rel_id: RelationshipId) -> Option<String> { ... } fn relationship_properties( &self, rel_id: RelationshipId, ) -> Option<Properties> { ... } fn relationship_property( &self, rel_id: RelationshipId, key: &str, ) -> Option<PropertyValue> { ... } fn relationship_endpoints( &self, rel_id: RelationshipId, ) -> Option<(NodeId, NodeId)> { ... } fn relationship_source(&self, rel_id: RelationshipId) -> Option<NodeId> { ... } fn relationship_target(&self, rel_id: RelationshipId) -> Option<NodeId> { ... } fn other_node( &self, rel_id: RelationshipId, node_id: NodeId, ) -> Option<NodeId> { ... } fn relationships_of( &self, node_id: NodeId, direction: Direction, ) -> Vec<RelationshipRecord> { ... } fn relationship_ids_of( &self, node_id: NodeId, direction: Direction, ) -> Vec<RelationshipId> { ... } fn expand( &self, node_id: NodeId, direction: Direction, types: &[String], ) -> Vec<(RelationshipRecord, NodeRecord)> { ... } fn expand_ids( &self, node_id: NodeId, direction: Direction, types: &[String], ) -> Vec<(RelationshipId, NodeId)> { ... } fn expand_detailed( &self, node_id: NodeId, direction: Direction, types: &[String], ) -> Vec<ExpandedRelationship> { ... } fn neighbors( &self, node_id: NodeId, direction: Direction, types: &[String], ) -> Vec<NodeRecord> { ... } fn degree(&self, node_id: NodeId, direction: Direction) -> usize { ... } fn is_isolated(&self, node_id: NodeId) -> bool { ... } fn find_nodes_by_property( &self, label: Option<&str>, key: &str, value: &PropertyValue, ) -> Vec<NodeRecord> { ... } fn find_relationships_by_property( &self, rel_type: Option<&str>, key: &str, value: &PropertyValue, ) -> Vec<RelationshipRecord> { ... } fn node_exists_with_label_and_property( &self, label: &str, key: &str, value: &PropertyValue, ) -> bool { ... } fn relationship_exists_with_type_and_property( &self, rel_type: &str, key: &str, value: &PropertyValue, ) -> bool { ... }
}

Required Methods§

Source

fn all_nodes(&self) -> Vec<NodeRecord>

Source

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

Source

fn node_ref(&self, id: NodeId) -> Option<&NodeRecord>

Borrow-based lookup. Required primitive; node() defaults to node_ref(id).cloned() so every implementation only has to supply the borrow variant.

Source

fn all_relationships(&self) -> Vec<RelationshipRecord>

Source

fn relationships_by_type(&self, rel_type: &str) -> Vec<RelationshipRecord>

Source

fn relationship_ref(&self, id: RelationshipId) -> Option<&RelationshipRecord>

Source

fn outgoing_relationships(&self, node_id: NodeId) -> Vec<RelationshipRecord>

Source

fn incoming_relationships(&self, node_id: NodeId) -> Vec<RelationshipRecord>

Provided Methods§

Source

fn node(&self, id: NodeId) -> Option<NodeRecord>

Source

fn has_node(&self, id: NodeId) -> bool

Source

fn node_count(&self) -> usize

Source

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

ID-only scan. Default falls back to cloning; implementations should override for O(nodes) without cloning records/properties.

Source

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

Index lookup returning only IDs. Default falls back to cloning.

Source

fn relationship(&self, id: RelationshipId) -> Option<RelationshipRecord>

Source

fn has_relationship(&self, id: RelationshipId) -> bool

Source

fn relationship_count(&self) -> usize

Source

fn all_rel_ids(&self) -> Vec<RelationshipId>

Source

fn rel_ids_by_type(&self, rel_type: &str) -> Vec<RelationshipId>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn label_property_keys(&self, label: &str) -> Vec<String>

Source

fn rel_type_property_keys(&self, rel_type: &str) -> Vec<String>

Source

fn has_label_name(&self, label: &str) -> bool

Source

fn has_relationship_type_name(&self, rel_type: &str) -> bool

Source

fn has_property_key(&self, key: &str) -> bool

Source

fn label_has_property_key(&self, label: &str, key: &str) -> bool

Source

fn rel_type_has_property_key(&self, rel_type: &str, key: &str) -> bool

Source

fn node_has_label(&self, node_id: NodeId, label: &str) -> bool

Source

fn node_labels(&self, node_id: NodeId) -> Option<Vec<String>>

Source

fn node_properties(&self, node_id: NodeId) -> Option<Properties>

Source

fn node_property(&self, node_id: NodeId, key: &str) -> Option<PropertyValue>

Source

fn relationship_type(&self, rel_id: RelationshipId) -> Option<String>

Source

fn relationship_properties(&self, rel_id: RelationshipId) -> Option<Properties>

Source

fn relationship_property( &self, rel_id: RelationshipId, key: &str, ) -> Option<PropertyValue>

Source

fn relationship_endpoints( &self, rel_id: RelationshipId, ) -> Option<(NodeId, NodeId)>

Source

fn relationship_source(&self, rel_id: RelationshipId) -> Option<NodeId>

Source

fn relationship_target(&self, rel_id: RelationshipId) -> Option<NodeId>

Source

fn other_node(&self, rel_id: RelationshipId, node_id: NodeId) -> Option<NodeId>

Source

fn relationships_of( &self, node_id: NodeId, direction: Direction, ) -> Vec<RelationshipRecord>

Source

fn relationship_ids_of( &self, node_id: NodeId, direction: Direction, ) -> Vec<RelationshipId>

ID-only variant of relationships_of. Default uses expand_ids so implementations without adjacency overrides still avoid record clones.

Source

fn expand( &self, node_id: NodeId, direction: Direction, types: &[String], ) -> Vec<(RelationshipRecord, NodeRecord)>

Source

fn expand_ids( &self, node_id: NodeId, direction: Direction, types: &[String], ) -> Vec<(RelationshipId, NodeId)>

Lightweight traversal used on hot paths: only returns (RelationshipId, NodeId) pairs, avoiding the record + property-map clones of expand().

Callers that need rel/node records can look them up with relationship_ref / node_ref.

Source

fn expand_detailed( &self, node_id: NodeId, direction: Direction, types: &[String], ) -> Vec<ExpandedRelationship>

Source

fn neighbors( &self, node_id: NodeId, direction: Direction, types: &[String], ) -> Vec<NodeRecord>

Source

fn degree(&self, node_id: NodeId, direction: Direction) -> usize

Source

fn is_isolated(&self, node_id: NodeId) -> bool

Source

fn find_nodes_by_property( &self, label: Option<&str>, key: &str, value: &PropertyValue, ) -> Vec<NodeRecord>

Source

fn find_relationships_by_property( &self, rel_type: Option<&str>, key: &str, value: &PropertyValue, ) -> Vec<RelationshipRecord>

Source

fn node_exists_with_label_and_property( &self, label: &str, key: &str, value: &PropertyValue, ) -> bool

Source

fn relationship_exists_with_type_and_property( &self, rel_type: &str, key: &str, value: &PropertyValue, ) -> bool

Implementors§