pub enum Value {
Null,
Bool(bool),
Int64(i64),
Float64(f64),
String(Arc<str>),
Bytes(Arc<[u8]>),
Timestamp(Timestamp),
List(Arc<[Value]>),
Map(Arc<BTreeMap<PropertyKey, Value>>),
}Expand description
A dynamically-typed property value.
This enum represents all possible value types that can be stored as properties on nodes and edges. It supports the GQL type system.
Variants§
Null
Null/missing value
Bool(bool)
Boolean value
Int64(i64)
64-bit signed integer
Float64(f64)
64-bit floating point
String(Arc<str>)
UTF-8 string (uses Arc for cheap cloning)
Bytes(Arc<[u8]>)
Binary data
Timestamp(Timestamp)
Timestamp with timezone
List(Arc<[Value]>)
Ordered list of values
Map(Arc<BTreeMap<PropertyKey, Value>>)
Key-value map (uses BTreeMap for deterministic ordering)
Implementations§
Source§impl Value
impl Value
Sourcepub const fn as_bool(&self) -> Option<bool>
pub const fn as_bool(&self) -> Option<bool>
Returns the boolean value if this is a Bool, otherwise None.
Sourcepub const fn as_int64(&self) -> Option<i64>
pub const fn as_int64(&self) -> Option<i64>
Returns the integer value if this is an Int64, otherwise None.
Sourcepub const fn as_float64(&self) -> Option<f64>
pub const fn as_float64(&self) -> Option<f64>
Returns the float value if this is a Float64, otherwise None.
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Returns the string value if this is a String, otherwise None.
Sourcepub fn as_bytes(&self) -> Option<&[u8]>
pub fn as_bytes(&self) -> Option<&[u8]>
Returns the bytes value if this is Bytes, otherwise None.
Sourcepub const fn as_timestamp(&self) -> Option<Timestamp>
pub const fn as_timestamp(&self) -> Option<Timestamp>
Returns the timestamp value if this is a Timestamp, otherwise None.
Sourcepub fn as_list(&self) -> Option<&[Value]>
pub fn as_list(&self) -> Option<&[Value]>
Returns the list value if this is a List, otherwise None.
Sourcepub fn as_map(&self) -> Option<&BTreeMap<PropertyKey, Value>>
pub fn as_map(&self) -> Option<&BTreeMap<PropertyKey, Value>>
Returns the map value if this is a Map, otherwise None.
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, DecodeError>
pub fn deserialize(bytes: &[u8]) -> Result<Self, DecodeError>
Deserializes a value from bytes.
§Errors
Returns an error if the bytes do not represent a valid Value.