pub enum CanonicalValue {
Show 15 variants
Null,
Bool(bool),
I64(i64),
U64(u64),
Decimal(Decimal),
Money(Money),
String(CanonicalString),
Bytes(CanonicalBytes),
Timestamp(Timestamp),
Date(Date),
Uuid([u8; 16]),
Enum {
type_id: EnumTypeId,
variant_id: EnumVariantId,
},
List(CanonicalList),
Record(CanonicalRecord),
Vector(CanonicalVector),
}Expand description
A value in RiffDB’s closed, deterministic transactional value algebra.
Constructors for variable-sized variants enforce process hard limits. The canonical encoder validates again so direct enum construction cannot bypass a durable-boundary check.
Variants§
Null
Explicit optional absence.
Bool(bool)
Boolean value.
I64(i64)
Signed 64-bit integer.
U64(u64)
Unsigned 64-bit integer.
Decimal(Decimal)
Checked fixed-scale decimal.
Money(Money)
Currency-qualified checked decimal.
String(CanonicalString)
Exact UTF-8 text without implicit normalization.
Bytes(CanonicalBytes)
Exact opaque bytes.
Timestamp(Timestamp)
UTC timestamp supplied by an input or deterministic transaction context.
Date(Date)
Calendar date represented as days since the Unix epoch.
Uuid([u8; 16])
UUID network-order bytes.
Enum
Stable enum type and variant IDs. Display names are not canonical.
List(CanonicalList)
Bounded ordered values.
Record(CanonicalRecord)
Fields in strictly increasing stable-ID order.
Vector(CanonicalVector)
A fixed-dimension f32 vector for nearest-neighbor search (ADR-0091).
Implementations§
Source§impl CanonicalValue
impl CanonicalValue
Sourcepub fn string(value: impl Into<String>) -> Result<Self, ValueError>
pub fn string(value: impl Into<String>) -> Result<Self, ValueError>
Constructs bounded exact UTF-8 text.
Sourcepub fn bytes(value: impl Into<Vec<u8>>) -> Result<Self, ValueError>
pub fn bytes(value: impl Into<Vec<u8>>) -> Result<Self, ValueError>
Constructs bounded exact bytes.
Sourcepub fn list(values: Vec<Self>) -> Result<Self, ValueError>
pub fn list(values: Vec<Self>) -> Result<Self, ValueError>
Constructs a bounded list without changing its order.