pub struct Row {
pub values: HashMap<String, Value>,
pub positional_values: Vec<Value>,
pub source_entities: HashMap<String, EntityId>,
pub text_score: Option<f64>,
pub highlight_snippet: Option<String>,
}Expand description
Single result row representing variable bindings
Fields§
§values: HashMap<String, Value>Named variable bindings (e.g., “p.name” -> “Alice”)
positional_values: Vec<Value>Positional values for set operations (ordered by variable declaration)
source_entities: HashMap<String, EntityId>Source entity IDs for identity-based set operations Maps variable names to their graph entity IDs (e.g., “p” -> Node ID)
text_score: Option<f64>Text search relevance score (for text_match results)
highlight_snippet: Option<String>Highlighted snippet (for highlight() results)
Implementations§
Source§impl Row
impl Row
Sourcepub fn from_values(values: HashMap<String, Value>) -> Row
pub fn from_values(values: HashMap<String, Value>) -> Row
Create a row from a HashMap of values (backward compatibility)
Sourcepub fn from_positional(values: Vec<Value>, variables: &[String]) -> Row
pub fn from_positional(values: Vec<Value>, variables: &[String]) -> Row
Create a row from positional values with variable names
Sourcepub fn set_text_score(&mut self, score: f64)
pub fn set_text_score(&mut self, score: f64)
Set text search score
Sourcepub fn get_text_score(&self) -> Option<f64>
pub fn get_text_score(&self) -> Option<f64>
Get text search score
Sourcepub fn set_highlight_snippet(&mut self, snippet: String)
pub fn set_highlight_snippet(&mut self, snippet: String)
Set highlight snippet
Sourcepub fn get_highlight_snippet(&self) -> Option<&str>
pub fn get_highlight_snippet(&self) -> Option<&str>
Get highlight snippet
Sourcepub fn add_value(&mut self, name: String, value: Value)
pub fn add_value(&mut self, name: String, value: Value)
Add a value to the row (both named and positional)
Sourcepub fn get_value_at_position(&self, position: usize) -> Option<&Value>
pub fn get_value_at_position(&self, position: usize) -> Option<&Value>
Get a value by position (for set operations)
Sourcepub fn with_entity(&mut self, var_name: &str, value: &Value)
pub fn with_entity(&mut self, var_name: &str, value: &Value)
Track the source entity for a variable This enables identity-based comparison in set operations
Sourcepub fn get_primary_entity(&self) -> Option<&EntityId>
pub fn get_primary_entity(&self) -> Option<&EntityId>
Get the primary entity ID for this row (if any) Used for simple identity comparisons
Sourcepub fn has_entities(&self) -> bool
pub fn has_entities(&self) -> bool
Check if this row has any tracked entities
Sourcepub fn get_entities(&self) -> &HashMap<String, EntityId>
pub fn get_entities(&self) -> &HashMap<String, EntityId>
Get all tracked entities for this row
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Row
impl<'de> Deserialize<'de> for Row
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Row, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Row, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Row
Source§impl Serialize for Row
impl Serialize for Row
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Row
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnsafeUnpin for Row
impl UnwindSafe for Row
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.