Skip to main content

Value

Enum Value 

Source
#[non_exhaustive]
pub enum Value {
Show 29 variants Bool(bool), Int(i64), Uint(u64), Int128(i128), Uint128(u128), Float(f64), Float32(f32), Decimal(Decimal), String(DbString), Bytes(Arc<[u8]>), List(Vec<Value>), Record(Box<Record>), RecordTyped(Box<RecordTyped>), Path(Box<Path>), NodeRef(NodeId), EdgeRef(EdgeId), GraphRef(GraphId), TableRef(BindingTableId), ZonedDateTime(Box<Zoned>), LocalDateTime(DateTime), Date(Date), ZonedTime(Box<Zoned>), LocalTime(Time), Duration(Box<Span>), Extended { type_id: ExtensionTypeId, payload: Arc<[u8]>, }, Null, Uuid(Uuid), Vector(VectorValue), Json(JsonValue),
}
Expand description

In-memory representation of a GQL value.

IA001: default floating-point arithmetic is IEEE 754 binary64; Float32 remains distinct for schema storage. Rust equality preserves GQL’s +0.0 == -0.0 behavior, while NaN ordering is handled by query-engine ORDER BY logic outside this crate.

Value equality matches IEEE 754 for non-NaN AND treats all NaN bit-patterns as equal for round-trip integrity. This is the internal Rust-level equality used by PropertyMap serde round-trip and snapshot diffs. The GQL = operator is intercepted at the runtime layer (runtime::value_compare) and preserves ISO 3VL semantics — NaN = NaN returns NULL there.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Bool(bool)

Boolean value.

§

Int(i64)

Signed integer up to 64 bits.

§

Uint(u64)

Unsigned integer up to 64 bits.

§

Int128(i128)

Signed 128-bit integer.

§

Uint128(u128)

Unsigned 128-bit integer.

§

Float(f64)

Default floating-point value.

§

Float32(f32)

Distinct 32-bit floating-point value.

§

Decimal(Decimal)

Fixed-precision decimal value.

§

String(DbString)

String value.

§

Bytes(Arc<[u8]>)

Byte-string value.

§

List(Vec<Value>)

List value.

§

Record(Box<Record>)

Open record value.

§

RecordTyped(Box<RecordTyped>)

Closed record value tied to a graph-type-defined record type.

§

Path(Box<Path>)

Path value.

Boxed (CORE-06): an inline Path is 120 B and was the size_of::<Value> ceiling. Paths are ephemeral traversal results, rarely stored, so moving one behind a pointer shrinks every Value clone/move to a pointer copy.

§

NodeRef(NodeId)

Node reference value.

§

EdgeRef(EdgeId)

Edge reference value.

§

GraphRef(GraphId)

Graph reference value.

§

TableRef(BindingTableId)

Binding-table reference value.

§

ZonedDateTime(Box<Zoned>)

Zoned datetime value.

Boxed (CORE-06): jiff::Zoned is 40 B; temporal values are uncommon in hot graph data, so the indirection is paid only on temporal access.

§

LocalDateTime(DateTime)

Local datetime value.

§

Date(Date)

Date value.

§

ZonedTime(Box<Zoned>)

Zoned time value.

jiff 0.2 has no dedicated zoned-time type, so selene-core uses jiff::Zoned; date components are ignored at the GQL boundary.

Boxed (CORE-06): see Value::ZonedDateTime.

§

LocalTime(Time)

Local time value.

§

Duration(Box<Span>)

Duration value.

Boxed (CORE-06): jiff::Span is 64 B (the largest time variant); boxing it keeps the post-Path ceiling off Value.

§

Extended

Extension-owned opaque payload.

Fields

§type_id: ExtensionTypeId

Registered extension type ID.

§payload: Arc<[u8]>

Extension-owned byte payload.

§

Null

Null value.

§

Uuid(Uuid)

UUID value.

§

Vector(VectorValue)

Native dense vector value.

§

Json(JsonValue)

Native JSON value.

Implementations§

Source§

impl Value

Source

pub const ALL: &[fn() -> Self]

Factory table with one sample value for each Value variant.

The table is used by tests as an append-only ANCHOR: adding a new variant requires adding one factory here so the source-of-truth crate owns the variant census.

Source

pub const VARIANT_COUNT: usize

Number of known Value variants in this build.

Source

pub fn variant_name(&self) -> &'static str

Stable telemetry name for this value variant.

This match is exhaustive in selene-core, so a future variant addition forces the defining crate to choose the new public name once.

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

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<'de> Deserialize<'de> for Value

Source§

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

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

impl PartialEq for Value

Source§

fn eq(&self, rhs: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Value

Source§

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

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
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.