pub trait GraphSnapshot {
type Neighbors<'a>: Iterator<Item = EdgeKey> + 'a
where Self: 'a;
Show 16 methods
// Required method
fn neighbors(
&self,
src: InternalNodeId,
rel: Option<RelTypeId>,
) -> Self::Neighbors<'_>;
// Provided methods
fn nodes(&self) -> Box<dyn Iterator<Item = InternalNodeId> + '_> { ... }
fn lookup_index(
&self,
_label: &str,
_field: &str,
_value: &PropertyValue,
) -> Option<Vec<InternalNodeId>> { ... }
fn resolve_external(&self, _iid: InternalNodeId) -> Option<ExternalId> { ... }
fn node_label(&self, _iid: InternalNodeId) -> Option<LabelId> { ... }
fn is_tombstoned_node(&self, _iid: InternalNodeId) -> bool { ... }
fn node_property(
&self,
_iid: InternalNodeId,
_key: &str,
) -> Option<PropertyValue> { ... }
fn edge_property(&self, _edge: EdgeKey, _key: &str) -> Option<PropertyValue> { ... }
fn node_properties(
&self,
_iid: InternalNodeId,
) -> Option<BTreeMap<String, PropertyValue>> { ... }
fn edge_properties(
&self,
_edge: EdgeKey,
) -> Option<BTreeMap<String, PropertyValue>> { ... }
fn resolve_label_id(&self, _name: &str) -> Option<LabelId> { ... }
fn resolve_rel_type_id(&self, _name: &str) -> Option<RelTypeId> { ... }
fn resolve_label_name(&self, _id: LabelId) -> Option<String> { ... }
fn resolve_rel_type_name(&self, _id: RelTypeId) -> Option<String> { ... }
fn node_count(&self, _label: Option<LabelId>) -> u64 { ... }
fn edge_count(&self, _rel: Option<RelTypeId>) -> u64 { ... }
}Expand description
A read-only snapshot of the graph state.
Snapshots are immutable and provide consistent views of the graph at the time of creation. Multiple snapshots can coexist.
Required Associated Types§
Required Methods§
Sourcefn neighbors(
&self,
src: InternalNodeId,
rel: Option<RelTypeId>,
) -> Self::Neighbors<'_>
fn neighbors( &self, src: InternalNodeId, rel: Option<RelTypeId>, ) -> Self::Neighbors<'_>
Get outgoing neighbors of a node, optionally filtered by relationship type.
Returns an iterator over EdgeKeys representing outgoing edges.
If rel is Some, only edges of that type are returned.
If rel is None, all outgoing edges are returned.
Provided Methods§
Sourcefn nodes(&self) -> Box<dyn Iterator<Item = InternalNodeId> + '_>
fn nodes(&self) -> Box<dyn Iterator<Item = InternalNodeId> + '_>
Get an iterator over all non-tombstoned nodes.
Returns an iterator over all internal node IDs that are not tombstoned. The default implementation returns an empty iterator.
Sourcefn lookup_index(
&self,
_label: &str,
_field: &str,
_value: &PropertyValue,
) -> Option<Vec<InternalNodeId>>
fn lookup_index( &self, _label: &str, _field: &str, _value: &PropertyValue, ) -> Option<Vec<InternalNodeId>>
Lookup nodes using an index.
Returns Some(Vec<InternalNodeId>) if the index exists and the lookup succeeds.
Returns None if the index does not exist.
§Arguments
label- The label name (e.g., “Person”)field- The property field name (e.g., “name”)value- The value to match
Sourcefn resolve_external(&self, _iid: InternalNodeId) -> Option<ExternalId>
fn resolve_external(&self, _iid: InternalNodeId) -> Option<ExternalId>
Resolve an internal node ID to its external ID.
Returns Some(external_id) if the node exists and has an external ID,
or None if the node doesn’t exist or has no external ID.
Sourcefn node_label(&self, _iid: InternalNodeId) -> Option<LabelId>
fn node_label(&self, _iid: InternalNodeId) -> Option<LabelId>
Get the label ID for a node.
Returns Some(label_id) if the node exists, None otherwise.
Sourcefn is_tombstoned_node(&self, _iid: InternalNodeId) -> bool
fn is_tombstoned_node(&self, _iid: InternalNodeId) -> bool
Check if a node is tombstoned (soft-deleted).
Tombstoned nodes are not returned by neighbors() or nodes().
Sourcefn node_property(
&self,
_iid: InternalNodeId,
_key: &str,
) -> Option<PropertyValue>
fn node_property( &self, _iid: InternalNodeId, _key: &str, ) -> Option<PropertyValue>
Get a property value for a node. Returns the value from the most recent transaction that set it.
Sourcefn edge_property(&self, _edge: EdgeKey, _key: &str) -> Option<PropertyValue>
fn edge_property(&self, _edge: EdgeKey, _key: &str) -> Option<PropertyValue>
Get a property value for an edge. Returns the value from the most recent transaction that set it.
Sourcefn node_properties(
&self,
_iid: InternalNodeId,
) -> Option<BTreeMap<String, PropertyValue>>
fn node_properties( &self, _iid: InternalNodeId, ) -> Option<BTreeMap<String, PropertyValue>>
Get all properties for a node. Returns properties merged from all runs (newest takes precedence).
Sourcefn edge_properties(
&self,
_edge: EdgeKey,
) -> Option<BTreeMap<String, PropertyValue>>
fn edge_properties( &self, _edge: EdgeKey, ) -> Option<BTreeMap<String, PropertyValue>>
Get all properties for an edge. Get all edge properties merged from all runs (newest takes precedence).
Sourcefn resolve_label_id(&self, _name: &str) -> Option<LabelId>
fn resolve_label_id(&self, _name: &str) -> Option<LabelId>
Resolve a label name to its ID.
Sourcefn resolve_rel_type_id(&self, _name: &str) -> Option<RelTypeId>
fn resolve_rel_type_id(&self, _name: &str) -> Option<RelTypeId>
Resolve a relationship type name to its ID.
Sourcefn resolve_label_name(&self, _id: LabelId) -> Option<String>
fn resolve_label_name(&self, _id: LabelId) -> Option<String>
Resolve a label ID to its name.
Sourcefn resolve_rel_type_name(&self, _id: RelTypeId) -> Option<String>
fn resolve_rel_type_name(&self, _id: RelTypeId) -> Option<String>
Resolve a relationship type ID to its name.
Sourcefn node_count(&self, _label: Option<LabelId>) -> u64
fn node_count(&self, _label: Option<LabelId>) -> u64
Get the estimated number of nodes, optionally filtered by label.
Sourcefn edge_count(&self, _rel: Option<RelTypeId>) -> u64
fn edge_count(&self, _rel: Option<RelTypeId>) -> u64
Get the estimated number of edges, optionally filtered by relationship type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.