Skip to main content

IrLiteral

Enum IrLiteral 

Source
pub enum IrLiteral {
Show 15 variants Null, Bool(bool), Int(i64), Float(f64), Str(String), Uuid([u8; 16]), Duration { months: i64, days: i64, seconds: i64, nanos: i64, }, DateTime(i64), Date(i64), LocalDateTime { days: i64, nanos: i64, }, Time(i64), ZonedTime { nanos: i64, offset: i32, }, ZonedDateTime { days: i64, nanos: i64, offset: i32, zone: Option<String>, }, List(Vec<IrLiteral>), Map(Vec<(String, IrLiteral)>),
}
Expand description

A scalar constant value in the Graph IR.

Temporal values are stored as microseconds since the Unix epoch (UTC), consistent with the Arrow Timestamp(Microsecond, "UTC") convention used throughout the project.

§Float serialisation

Finite Float values serialise as JSON numbers. Non-finite IEEE-754 values (NaN, +Infinity, -Infinity) that serde_json cannot represent as JSON numbers are encoded as a tagged object {"$float": "<tag>"} where <tag> is "NaN", "+Infinity", or "-Infinity". This preserves full round-trip fidelity rather than silently collapsing to null.

Variants§

§

Null

The Cypher null value.

§

Bool(bool)

A boolean constant.

§

Int(i64)

A 64-bit integer constant.

§

Float(f64)

A 64-bit floating-point constant.

Non-finite values (NaN, ±Infinity) are supported and round-trip through JSON via a tagged encoding; see the enum-level docs.

§

Str(String)

A UTF-8 string constant.

§

Uuid([u8; 16])

A typed UUID query parameter, stored as its canonical 16-byte identity. This is not Cypher syntax and must not be inferred from strings.

§

Duration

A Cypher duration as signed months/days/nanos (ADR 0009): months and days kept distinct from sub-day time. Persisted as a Struct{months,days,nanos} (Parquet cannot store Arrow Interval). (#920)

Fields

§months: i64

Signed whole months.

§days: i64

Signed whole days.

§seconds: i64

Signed whole sub-day seconds (split from nanos so billion-year spans fit i64). (#1011)

§nanos: i64

Signed nanoseconds-of-second, (-1e9, 1e9), same sign as seconds.

§

DateTime(i64)

A point-in-time expressed as microseconds since the Unix epoch (UTC).

§

Date(i64)

A calendar date as i64 days since the Unix epoch — the full openCypher year range −999,999,999..+999,999,999. Persisted as a self-describing Struct{epoch_day: Int64} (a bare Int64 is indistinguishable from an integer property). (#920/#1011)

§

LocalDateTime

A Cypher localdatetime (ADR 0009): a date (days since the Unix epoch) plus a time-of-day (nanos since midnight), with no zone. Persisted as a Struct{date: Int64, time: Time64(ns)}. (#920/#1011)

Fields

§days: i64

Days since the Unix epoch (i64, full year range).

§nanos: i64

Nanoseconds since midnight (Arrow Time64(ns)).

§

Time(i64)

A Cypher localtime (ADR 0009): a time-of-day in nanoseconds since midnight, no zone. Persisted as a native Arrow Time64(ns) column. (#920)

§

ZonedTime

A Cypher time (ADR 0009): a time-of-day plus its UTC offset in seconds. Persisted as a Struct{time: Time64(ns), offset: Int32}. (#920)

Fields

§nanos: i64

Nanoseconds since midnight (Arrow Time64(ns)).

§offset: i32

UTC offset in seconds.

§

ZonedDateTime

A Cypher datetime (ADR 0009): a date+time, its UTC offset in seconds, and an optional named IANA zone. Persisted as a Struct{date: Date32, time: Time64(ns), offset: Int32, zone: Utf8}. Distinct from IrLiteral::DateTime (a bare UTC micros instant). (#920/#1011)

Fields

§days: i64

Days since the Unix epoch (i64, full year range).

§nanos: i64

Nanoseconds since midnight (Arrow Time64(ns)).

§offset: i32

UTC offset in seconds.

§zone: Option<String>

Named IANA zone, or None for an offset-only datetime.

§

List(Vec<IrLiteral>)

A homogeneous list of values, persisted as an Arrow List<inner> column (the inner type is inferred from the elements). Stores e.g. a property whose value is [date(…), date(…)]. Heterogeneous lists are out of scope (#1005). (#1006)

§

Map(Vec<(String, IrLiteral)>)

A query-parameter map value. Map literals in parsed Cypher still lower as IrExpr::MapLiteral; this variant lets callers bind $param to a map through execute_with_params and then use Cypher value access on it.

Trait Implementations§

Source§

impl Clone for IrLiteral

Source§

fn clone(&self) -> IrLiteral

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 IrLiteral

Source§

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

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

impl<'de> Deserialize<'de> for IrLiteral

Source§

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

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

impl PartialEq for IrLiteral

Source§

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

Source§

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

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

impl StructuralPartialEq for IrLiteral

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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.