#[repr(u8)]pub enum DataType {
Show 55 variants
Unknown = 0,
Integer = 1,
UnsignedInteger = 2,
Float = 3,
Text = 4,
Blob = 5,
Boolean = 6,
Timestamp = 7,
Duration = 8,
IpAddr = 9,
MacAddr = 10,
Vector = 11,
Nullable = 12,
Json = 13,
Uuid = 14,
NodeRef = 15,
EdgeRef = 16,
VectorRef = 17,
RowRef = 18,
Color = 19,
Email = 20,
Url = 21,
Phone = 22,
Semver = 23,
Cidr = 24,
Date = 25,
Time = 26,
Decimal = 27,
Enum = 28,
Array = 29,
TimestampMs = 30,
Ipv4 = 31,
Ipv6 = 32,
Subnet = 33,
Port = 34,
Latitude = 35,
Longitude = 36,
GeoPoint = 37,
Country2 = 38,
Country3 = 39,
Lang2 = 40,
Lang5 = 41,
Currency = 42,
ColorAlpha = 43,
BigInt = 44,
KeyRef = 45,
DocRef = 46,
TableRef = 47,
PageRef = 48,
Secret = 49,
Password = 50,
TextZstd = 51,
BlobZstd = 52,
AssetCode = 53,
Money = 54,
}Expand description
Type identifier for column definitions
Variants§
Unknown = 0
Polymorphic / “any” placeholder. Used by function-catalog
signatures (e.g. JSON_SET(json, path, value) where value
accepts any scalar) so the resolver can skip concrete type
checking for that argument. Never appears in stored schemas.
Integer = 1
Signed 64-bit integer
UnsignedInteger = 2
Unsigned 64-bit integer
Float = 3
64-bit floating point
Text = 4
Variable-length UTF-8 text
Blob = 5
Variable-length binary data
Boolean = 6
Boolean (true/false)
Timestamp = 7
Unix timestamp (seconds since epoch)
Duration = 8
Duration in milliseconds
IpAddr = 9
IPv4 or IPv6 address
MacAddr = 10
MAC address (6 bytes)
Vector = 11
Fixed-dimension float vector (for similarity search)
Nullable = 12
Nullable wrapper (stores inner type in high nibble)
Json = 13
JSON-like structured data
Uuid = 14
UUID (16 bytes)
NodeRef = 15
Reference to a graph node (for unified queries)
EdgeRef = 16
Reference to a graph edge
VectorRef = 17
Reference to a vector in vector store
RowRef = 18
Reference to a table row (table_id, row_id)
Color = 19
RGB color (3 bytes)
Email = 20
Email address (validated, stored lowercase)
Url = 21
URL (validated)
Phone = 22
Phone number (stored as u64 digits)
Semver = 23
Semantic version (packed u32: major1M + minor1K + patch)
Cidr = 24
CIDR notation (IPv4 u32 + prefix u8 = 5 bytes)
Date = 25
Date only (i32 days since Unix epoch, no time)
Time = 26
Time only (u32 milliseconds since midnight)
Decimal = 27
Fixed-point decimal (i64 with configurable precision)
Enum = 28
Enumerated type (u8 index into variant list)
Array = 29
Array of values (homogeneous)
TimestampMs = 30
Timestamp with millisecond precision (i64 ms since epoch)
Ipv4 = 31
IPv4 address (u32)
Ipv6 = 32
IPv6 address ([u8; 16])
Subnet = 33
Network subnet (ip u32 + mask u32)
Port = 34
TCP/UDP port number (u16)
Latitude = 35
Geographic latitude (i32 microdegrees)
Longitude = 36
Geographic longitude (i32 microdegrees)
GeoPoint = 37
Geographic point (lat i32 + lon i32)
Country2 = 38
ISO 3166-1 alpha-2 country code ([u8; 2])
Country3 = 39
ISO 3166-1 alpha-3 country code ([u8; 3])
Lang2 = 40
ISO 639-1 language code ([u8; 2])
Lang5 = 41
IETF language tag, e.g. “pt-BR” ([u8; 5])
Currency = 42
ISO 4217 currency code ([u8; 3])
ColorAlpha = 43
RGBA color with alpha ([u8; 4])
BigInt = 44
Signed 64-bit integer (alias for large numbers)
KeyRef = 45
Reference to a KV pair (collection, key string)
DocRef = 46
Reference to a document (collection, entity_id)
TableRef = 47
Reference to a table/collection by name
PageRef = 48
Reference to a physical storage page
Secret = 49
Encrypted secret (AES-256-GCM ciphertext, keyed by vault AES key)
Password = 50
Argon2id password hash
TextZstd = 51
C3 TOAST: zstd-compressed UTF-8 text (> TOAST_THRESHOLD bytes).
In-memory representation is always Value::Text — compression is
transparent to all callers above the serialization layer.
BlobZstd = 52
C3 TOAST: zstd-compressed binary blob (> TOAST_THRESHOLD bytes).
In-memory representation is always Value::Blob.
AssetCode = 53
General asset code (fiat or crypto), validated and normalized uppercase text
Money = 54
Monetary amount represented as minor units + scale + asset code
Implementations§
Source§impl DataType
impl DataType
Sourcepub fn category(&self) -> TypeCategory
pub fn category(&self) -> TypeCategory
Return the coercion category this type belongs to. Used by the Fase 3 operator / function resolver to group candidate types when picking an overload.
Sourcepub fn is_preferred(&self) -> bool
pub fn is_preferred(&self) -> bool
Is this type the preferred representative of its category? When the Fase 3 resolver has two equally-good candidates after exact-match counting, it picks the preferred one. Preferences are:
- Numeric:
Float(highest precision, captures all integer values lossily for arithmetic purposes) - String:
Text - DateTime:
TimestampMs(milli precision beats second) - Network:
IpAddr(superset of Ipv4/Ipv6) - Domain / Reference / Opaque / others: no preferred member (categories where every type is equally “native” so a tie means the user must be explicit).
Source§impl DataType
impl DataType
Sourcepub fn from_sql_name(name: &str) -> Option<DataType>
pub fn from_sql_name(name: &str) -> Option<DataType>
Resolve a DataType from an SQL-level type name (case-insensitive).
Accepts short SQL aliases (INT → Integer, STRING → Text) plus the
canonical reddb names rendered by Display. Returns None for
unknown / unsupported names so callers can surface a parse error.
Sourcepub fn from_sql_type_name(sql_type: &SqlTypeName) -> Option<DataType>
pub fn from_sql_type_name(sql_type: &SqlTypeName) -> Option<DataType>
Resolve a DataType from a parsed SQL type name.
Sourcepub fn fixed_size(&self) -> Option<usize>
pub fn fixed_size(&self) -> Option<usize>
Returns the fixed size in bytes if known, None for variable-length types
Sourcepub fn is_indexable(&self) -> bool
pub fn is_indexable(&self) -> bool
Check if this type supports indexing
Sourcepub fn is_orderable(&self) -> bool
pub fn is_orderable(&self) -> bool
Check if this type supports ordering
Trait Implementations§
impl Copy for DataType
impl Eq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnsafeUnpin for DataType
impl UnwindSafe for DataType
Blanket Implementations§
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request