pub enum Value {
Int64(i64),
Bytes(Vec<u8>),
Float(f64),
}Expand description
A typed property value.
Variants§
Int64(i64)
Signed 64-bit integer, stored as raw u64 bits (two’s-complement).
Bytes(Vec<u8>)
Raw byte blob, stored as a fixed-width 8-byte reference in v1. The actual bytes are placed inline for values ≤ 8 bytes; longer blobs are truncated and marked with a sentinel in v1 (overflow deferred).
Float(f64)
IEEE-754 double-precision float. Stored as 8 raw bytes in the overflow heap so that no bits are masked by the type-tag scheme (SPA-267).
Implementations§
Source§impl Value
impl Value
Sourcepub fn to_u64(&self) -> u64
pub fn to_u64(&self) -> u64
Encode as a packed u64 for column storage.
The top byte (byte 7 in little-endian) is a type tag; the remaining
7 bytes carry the payload. This allows from_u64 to reconstruct the
correct variant at read time (SPA-169).
For Bytes values that exceed 7 bytes, this method only encodes the
first 7 bytes inline. Callers that need full overflow support must use
NodeStore::encode_value instead, which writes long strings to the
heap and returns an overflow-tagged u64 (SPA-212).
§Int64 range
Only the lower 56 bits of the integer are stored. This covers all practical node IDs and numeric property values; very large i64 values (> 2^55 or < -2^55) would be truncated. Full 64-bit range is deferred to a later overflow encoding.
Sourcepub fn from_u64(v: u64) -> Self
pub fn from_u64(v: u64) -> Self
Reconstruct a Value from a stored u64, using the top byte as a
type tag (SPA-169).
Only handles inline encodings (TAG_INT64 and TAG_BYTES).
For overflow strings (TAG_BYTES_OVERFLOW), use NodeStore::decode_raw_value
which has access to the string heap (SPA-212).
Sourcepub fn int64_from_u64(v: u64) -> Self
pub fn int64_from_u64(v: u64) -> Self
Reconstruct an Int64 value from a stored u64.
Preserved for callers that know the column type is always Int64 (e.g.
pre-SPA-169 paths). New code should prefer from_u64.