Skip to main content

InMemoryGraph

Struct InMemoryGraph 

Source
pub struct InMemoryGraph { /* private fields */ }

Implementations§

Source§

impl InMemoryGraph

Source

pub fn new() -> Self

Source

pub fn with_capacity_hint(_nodes: usize, _relationships: usize) -> Self

Source

pub fn clear(&mut self)

Source

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

Source

pub fn contains_relationship(&self, rel_id: RelationshipId) -> bool

Trait Implementations§

Source§

impl Clone for InMemoryGraph

Source§

fn clone(&self) -> InMemoryGraph

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InMemoryGraph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InMemoryGraph

Source§

fn default() -> InMemoryGraph

Returns the “default value” for a type. Read more
Source§

impl GraphStorage for InMemoryGraph

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_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 node_count(&self) -> usize

Source§

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

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 all_rel_ids(&self) -> Vec<RelationshipId>

Source§

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

Source§

fn relationship_count(&self) -> usize

Source§

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

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 label_property_keys(&self, label: &str) -> Vec<String>

Source§

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

Source§

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

Source§

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

Source§

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

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(). Read more
Source§

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

Source§

fn incoming_relationships(&self, node_id: NodeId) -> 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 degree(&self, node_id: NodeId, direction: Direction) -> usize

Source§

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

Source§

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

Source§

fn all_property_keys(&self) -> 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_labels(&self, node_id: NodeId) -> Option<Vec<String>>

Source§

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

Source§

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

Source§

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

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 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 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

Source§

impl GraphStorageMut for InMemoryGraph

Source§

fn create_node( &mut self, labels: Vec<String>, properties: Properties, ) -> NodeRecord

Source§

fn create_relationship( &mut self, src: NodeId, dst: NodeId, rel_type: &str, properties: Properties, ) -> Option<RelationshipRecord>

Source§

fn set_node_property( &mut self, node_id: NodeId, key: String, value: PropertyValue, ) -> bool

Source§

fn remove_node_property(&mut self, node_id: NodeId, key: &str) -> bool

Source§

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

Source§

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

Source§

fn set_relationship_property( &mut self, rel_id: RelationshipId, key: String, value: PropertyValue, ) -> bool

Source§

fn remove_relationship_property( &mut self, rel_id: RelationshipId, key: &str, ) -> bool

Source§

fn delete_relationship(&mut self, rel_id: RelationshipId) -> bool

Source§

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

Returns false if the node still has attached relationships.
Source§

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

Deletes the node and all attached relationships.
Source§

fn replace_node_properties( &mut self, node_id: NodeId, properties: Properties, ) -> bool

Source§

fn merge_node_properties( &mut self, node_id: NodeId, properties: Properties, ) -> bool

Source§

fn set_node_labels(&mut self, node_id: NodeId, labels: Vec<String>) -> bool

Source§

fn replace_relationship_properties( &mut self, rel_id: RelationshipId, properties: Properties, ) -> bool

Source§

fn merge_relationship_properties( &mut self, rel_id: RelationshipId, properties: Properties, ) -> bool

Source§

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

Source§

fn get_or_create_node( &mut self, labels: Vec<String>, match_key: &str, match_value: &PropertyValue, init_properties: Properties, ) -> NodeRecord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.