Skip to main content

Row

Struct Row 

Source
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

Source

pub fn new() -> Row

Create a new empty row

Source

pub fn from_values(values: HashMap<String, Value>) -> Row

Create a row from a HashMap of values (backward compatibility)

Source

pub fn from_positional(values: Vec<Value>, variables: &[String]) -> Row

Create a row from positional values with variable names

Source

pub fn set_text_score(&mut self, score: f64)

Set text search score

Source

pub fn get_text_score(&self) -> Option<f64>

Get text search score

Source

pub fn set_highlight_snippet(&mut self, snippet: String)

Set highlight snippet

Source

pub fn get_highlight_snippet(&self) -> Option<&str>

Get highlight snippet

Source

pub fn add_value(&mut self, name: String, value: Value)

Add a value to the row (both named and positional)

Source

pub fn get_value(&self, name: &str) -> Option<&Value>

Get a value by variable name

Source

pub fn get_value_at_position(&self, position: usize) -> Option<&Value>

Get a value by position (for set operations)

Source

pub fn set_value(&mut self, name: String, value: Value)

Set a value in the row

Source

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

Source

pub fn get_primary_entity(&self) -> Option<&EntityId>

Get the primary entity ID for this row (if any) Used for simple identity comparisons

Source

pub fn has_entities(&self) -> bool

Check if this row has any tracked entities

Source

pub fn get_entities(&self) -> &HashMap<String, EntityId>

Get all tracked entities for this row

Trait Implementations§

Source§

impl Clone for Row

Source§

fn clone(&self) -> Row

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Row

Source§

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

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

impl Default for Row

Source§

fn default() -> Row

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

impl<'de> Deserialize<'de> for Row

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Row, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Row

Source§

impl Hash for Row

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Row

Source§

fn eq(&self, other: &Row) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Row

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = !

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.