pub enum Value {
Node(NodeId, Node),
NodeRef(NodeId),
Edge(EdgeId, Edge),
EdgeRef(EdgeId, NodeId, NodeId, EdgeType),
Property(PropertyValue),
Path {
nodes: Vec<NodeId>,
edges: Vec<EdgeId>,
},
Null,
}Expand description
Value types that can be bound to variables in a query record.
The key design choice here is the late materialization hierarchy:
-
NodeRef(id)– a lazy reference. Stores only the 64-bitNodeId. Produced by scan and expand operators. Extremely cheap to create (no heap allocation, no cloning). Properties are resolved on demand viaresolve_property(prop, store). -
Node(id, node)– a fully materialized node. Contains a clone of theNodestruct with all labels and properties. Produced byProjectOperatorwhen the RETURN clause requestsRETURN n(the entire node), triggering full materialization.
The same lazy/eager split exists for edges: EdgeRef(id, src, tgt, type) carries the
structural data (endpoints and type) without property clones, while Edge(id, edge)
is fully materialized.
Property(PropertyValue) wraps scalar values (strings, integers, floats, booleans,
datetimes, arrays, maps) that result from property access (n.name) or literal
expressions. Path stores ordered sequences of node/edge IDs for named path patterns
like p = (a)-[]->(b). Null represents the absence of a value, following Cypher’s
three-valued logic (true/false/null).
Variants§
Node(NodeId, Node)
A fully materialized node
NodeRef(NodeId)
A lazy node reference (no property clone)
Edge(EdgeId, Edge)
A fully materialized edge
EdgeRef(EdgeId, NodeId, NodeId, EdgeType)
A lazy edge reference (structural data only, no property clone)
Property(PropertyValue)
A property value
Path
A path (ordered sequence of node/edge IDs)
Null
Null
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_node(&self) -> Option<(NodeId, &Node)>
pub fn as_node(&self) -> Option<(NodeId, &Node)>
Get as node if this is a fully materialized node value
Sourcepub fn as_edge(&self) -> Option<(EdgeId, &Edge)>
pub fn as_edge(&self) -> Option<(EdgeId, &Edge)>
Get as edge if this is a fully materialized edge value
Sourcepub fn as_property(&self) -> Option<&PropertyValue>
pub fn as_property(&self) -> Option<&PropertyValue>
Get as property if this is a property value
Sourcepub fn edge_endpoints(&self) -> Option<(NodeId, NodeId)>
pub fn edge_endpoints(&self) -> Option<(NodeId, NodeId)>
Extract edge endpoints from any edge variant
Sourcepub fn materialize_node(self, store: &GraphStore) -> Self
pub fn materialize_node(self, store: &GraphStore) -> Self
Materialize a NodeRef into a full Node by looking it up in the store. Returns self unchanged if already materialized or not a node variant.
Sourcepub fn materialize_edge(self, store: &GraphStore) -> Self
pub fn materialize_edge(self, store: &GraphStore) -> Self
Materialize an EdgeRef into a full Edge by looking it up in the store. Returns self unchanged if already materialized or not an edge variant.
Sourcepub fn resolve_property(
&self,
property: &str,
store: &GraphStore,
) -> PropertyValue
pub fn resolve_property( &self, property: &str, store: &GraphStore, ) -> PropertyValue
Resolve a property from this value, using columnar store first, then falling back to materialized node/edge properties or store lookup for refs.
Trait Implementations§
impl Eq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more