pub enum Value {
Show 18 variants
Null,
Bool(bool),
Integer(i64),
Float(f64),
String(String),
Bytes(Vec<u8>),
Array(Vec<Value>),
Object(HashMap<String, Value>),
Uuid(String),
Ulid(String),
DateTime(NdbDateTime),
Duration(NdbDuration),
Decimal(Decimal),
Geometry(Geometry),
Set(Vec<Value>),
Regex(String),
Range {
start: Option<Box<Value>>,
end: Option<Box<Value>>,
inclusive: bool,
},
Record {
table: String,
id: String,
},
}Expand description
A dynamic value that can represent any field type in a document or any parameter in a SQL query.
Variants§
Null
SQL NULL / missing value.
Bool(bool)
Boolean.
Integer(i64)
Signed 64-bit integer.
Float(f64)
64-bit floating point.
String(String)
UTF-8 string.
Bytes(Vec<u8>)
Raw bytes (embeddings, serialized blobs).
Array(Vec<Value>)
Ordered array of values.
Object(HashMap<String, Value>)
Nested key-value object.
Uuid(String)
UUID (any version, stored as 36-char hyphenated string).
Ulid(String)
ULID (26-char Crockford Base32).
DateTime(NdbDateTime)
UTC timestamp with microsecond precision.
Duration(NdbDuration)
Duration with microsecond precision (signed).
Decimal(Decimal)
Arbitrary-precision decimal (financial calculations, exact arithmetic).
Geometry(Geometry)
GeoJSON-compatible geometry (Point, LineString, Polygon, etc.).
Set(Vec<Value>)
Ordered set of unique values (auto-deduplicated, maintains insertion order).
Regex(String)
Compiled regex pattern (stored as pattern string).
Range
A range of values with optional bounds.
Fields
Record
A typed reference to another record: table:id.
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_datetime(&self) -> Option<&NdbDateTime>
pub fn as_datetime(&self) -> Option<&NdbDateTime>
Try to extract as DateTime.
Sourcepub fn as_duration(&self) -> Option<&NdbDuration>
pub fn as_duration(&self) -> Option<&NdbDuration>
Try to extract as Duration.
Sourcepub fn as_decimal(&self) -> Option<&Decimal>
pub fn as_decimal(&self) -> Option<&Decimal>
Try to extract as Decimal.
Sourcepub fn as_geometry(&self) -> Option<&Geometry>
pub fn as_geometry(&self) -> Option<&Geometry>
Try to extract as Geometry.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<NdbDateTime> for Value
impl From<NdbDateTime> for Value
Source§fn from(dt: NdbDateTime) -> Self
fn from(dt: NdbDateTime) -> Self
Source§impl From<NdbDuration> for Value
impl From<NdbDuration> for Value
Source§fn from(d: NdbDuration) -> Self
fn from(d: NdbDuration) -> Self
impl StructuralPartialEq for Value
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.