Skip to main content

Value

Enum Value 

Source
pub enum Value {
Show 15 variants Null, Bool(bool), Int(i64), Float(f64), String(Arc<str>), List(Arc<Vec<Value>>), Map(Arc<BTreeMap<String, Value>>), Node(Arc<Node>), Relationship(Arc<Relationship>), Path(Arc<Path>), Temporal(Temporal), Point(PointValue), Uuid(u128), Vector { coord: VectorCoordKind, values: Arc<Vec<Value>>, }, Bytes(Arc<[u8]>),
}
Expand description

OpenCypher runtime value.

Variants§

§

Null

§

Bool(bool)

§

Int(i64)

§

Float(f64)

§

String(Arc<str>)

§

List(Arc<Vec<Value>>)

§

Map(Arc<BTreeMap<String, Value>>)

§

Node(Arc<Node>)

§

Relationship(Arc<Relationship>)

§

Path(Arc<Path>)

§

Temporal(Temporal)

§

Point(PointValue)

§

Uuid(u128)

CIP-246 UUID: 128-bit value, rendered as the canonical lowercase hyphenated string (to_display_string/iso-style bare form) and constructible from a string or two 64-bit halves.

§

Vector

Fields

§values: Arc<Vec<Value>>
§

Bytes(Arc<[u8]>)

A byte array (ADR-0327). Statement-scoped: it enters only as a query parameter (Bolt PackStream Bytes) and flows through expressions, lists and maps into results; storing it as a property fails with a typed TypeError. Shared payload like String (ADR-0170).

Implementations§

Source§

impl Value

Source

pub fn depth_within(&self, limit: u32) -> bool

Whether every container in this value nests at most limit levels deep (ADR-0462). Iterative over an explicit worklist — never recursive — so an over-deep value is rejected without first growing the stack to its depth.

A scalar has depth 0; a container’s own level is one more than its parent’s, so [] is depth 1 and [[]] depth 2. Node, relationship and path values count as containers, and their property values nest inside them.

Source

pub fn check_depth(&self) -> Result<()>

The typed depth guard: Ok when this value nests at most MAX_VALUE_DEPTH levels (ADR-0462), else a ValueDepthExceeded execution error. The Kind: prefix is the token the error channel classifies (ErrorKind::ValueDepthExceeded).

Source

pub fn depth(&self) -> u32

This value’s exact container depth (scalar 0, [] 1, [[]] 2), walked iteratively once. For a value whose depth is already known, Value::checked_list_with_depth avoids this walk.

The walk memoizes container payloads by identity: a shared subtree is measured once, so the cost is linear in distinct payloads, never in the expanded node count of a fan-out DAG (a [acc, acc] chain would otherwise expand exponentially). A walk that exceeds [MAX_DEPTH_WALK_STEPS] conservatively answers u32::MAX (over any cap), so it can refuse but never hang.

Source

pub fn checked_list(values: Vec<Value>) -> Result<Value>

Build a list value, rejecting one that would nest deeper than MAX_VALUE_DEPTH (ADR-0462). The one constructor for a list the evaluator builds from dynamic expression results.

Source

pub fn checked_map(values: BTreeMap<String, Value>) -> Result<Value>

Build a map value, rejecting one that would nest deeper than MAX_VALUE_DEPTH (ADR-0462). The one constructor for a map the evaluator builds from dynamic expression results.

Source§

impl Value

Source

pub fn to_json_tagged(&self) -> Value

The tagged {"t":..., "v":...} JSON form. Built from the canonical serde::Serialize impl (via [TaggedRef]), so the tree here and the direct WAL/checkpoint bytes cannot diverge. Graph entities are not persistence properties: the encoder rejects them (see [TaggedRef]), and that internal error maps to Null here.

Source

pub fn from_json_tagged(v: &Value) -> Result<Value>

Source

pub fn to_json_plain(&self) -> Value

Best-effort Python/JSON-ish value for FFI clients.

Source

pub fn from_json_plain(v: &Value) -> Value

Source

pub fn from_json_scalars(v: &Value) -> Value

Decode JSON whose objects are always maps. A _type of node, point, or vector stays a string property. This is the decoder for untrusted property documents. [from_json_plain] is the inverse of [to_json_plain] and still recognizes those tags.

Source§

impl Value

Source

pub fn cypher_eq(&self, other: &Value) -> Value

Cypher equality: numbers compare across int/float; null = x is null. Lists and maps are three-valued: any false pair yields false; otherwise any null pair yields null.

Source

pub fn eq_non_null(&self, other: &Value) -> bool

Source

pub fn compare(&self, other: &Value) -> Option<Ordering>

Cypher’s three-valued ordering over one type-pair (None = null: the pair is incomparable, or a null operand reached here). Orderable: numbers, strings, bytes, booleans, lists, maps, and the temporal kinds except durations. Not orderable despite having =: UUIDs, points, durations, and any cross-type pair — the <=/>= arms of the comparison operators still hold for equal operands (cmp_bool).

Source

pub fn order_by_cmp(&self, other: &Value) -> Ordering

Total order for ORDER BY / min / max. Comparison operators still use compare, which is three-valued and incomparable across types.

Source§

impl Value

Source

pub fn from_node(node: Node) -> Self

Share one node across every row that clones this value.

Source

pub fn from_relationship(rel: Relationship) -> Self

Share one relationship across every row that clones this value.

Source

pub fn from_path(path: Path) -> Self

Share one path across every row that clones this value.

Source

pub fn logical_bytes(&self) -> u64

Documented logical payload size (ADR-0042) — the per-variant accumulation of the sizes str_logical_bytes spells for strings.

Source

pub fn as_temporal(&self) -> Option<&Temporal>

Source

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

Source

pub fn is_null(&self) -> bool

Source

pub fn as_bool(&self) -> Option<bool>

Source

pub fn truthy(&self) -> Option<bool>

Cypher toBoolean-ish: true/false stay, null stays none.

Source

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

Source

pub fn as_int(&self) -> Option<i64>

Source

pub fn to_cypher_literal(&self) -> String

Source

pub fn to_display_string(&self) -> String

The CIP-271 toString() rendering: the cypher-shell display form rather than the round-trippable literal form — strings are unquoted, temporals are bare full-precision ISO strings (ADR-0448), and maps/lists render recursively with , separators (verified against Neo4j 2026.09.0).

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Self

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 Value

Source§

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

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

impl Default for Value

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Value

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

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

impl Display for Value

Source§

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

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

impl PartialEq for Value

Source§

fn eq(&self, other: &Self) -> 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 Value

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Forget for Value

§

impl Freeze for Value

§

impl Move 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> 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<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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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, !>

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.