pub enum KalamDataType {
}Expand description
Unified data type enum with wire format tags
Each variant has an associated tag byte for wire format serialization:
- BOOLEAN = 0x01
- INT = 0x02 (32-bit signed integer)
- BIGINT = 0x03 (64-bit signed integer)
- DOUBLE = 0x04 (64-bit floating point)
- FLOAT = 0x05 (32-bit floating point)
- TEXT = 0x06 (UTF-8 string)
- TIMESTAMP = 0x07 (microseconds since epoch)
- DATE = 0x08 (days since epoch)
- DATETIME = 0x09 (datetime with timezone)
- TIME = 0x0A (time of day)
- JSON = 0x0B (JSON document)
- BYTES = 0x0C (binary data)
- EMBEDDING = 0x0D (fixed-size float32 vector with dimension parameter)
- UUID = 0x0E (128-bit universally unique identifier)
- DECIMAL = 0x0F (fixed-point decimal with precision and scale)
- SMALLINT = 0x10 (16-bit signed integer)
- FILE = 0x11 (file reference - stored as JSON FileRef object)
Variants§
Boolean
Boolean type (0x01)
Int
32-bit signed integer (0x02)
BigInt
64-bit signed integer (0x03)
Double
64-bit floating point (0x04)
Float
32-bit floating point (0x05)
Text
UTF-8 string (0x06)
Timestamp
Timestamp with microsecond precision (0x07)
Date
Date (days since epoch) (0x08)
DateTime
DateTime with timezone (0x09)
Time
Time of day (0x0A)
Json
JSON document (0x0B)
Bytes
Binary data (0x0C)
Embedding(usize)
Fixed-size float32 vector for embeddings (0x0D) Parameter: dimension (1 ≤ dim ≤ 8192)
Uuid
UUID (128-bit universally unique identifier) (0x0E) Stored as 16 bytes in standard RFC 4122 format
Decimal
Fixed-point decimal (0x0F) Parameters: precision (total digits 1-38), scale (decimal places 0-precision) Example: DECIMAL(10, 2) can store values like 12345678.90
SmallInt
16-bit signed integer (0x10) Range: -32,768 to 32,767
File
File reference (0x11) Stored as a JSON FileRef object containing file metadata (id, subfolder, name, size, mime, sha256)
Implementations§
Source§impl KalamDataType
impl KalamDataType
Sourcepub fn from_tag(tag: u8) -> Result<KalamDataType, String>
pub fn from_tag(tag: u8) -> Result<KalamDataType, String>
Create a KalamDataType from a wire format tag
Sourcepub fn validate_embedding_dimension(dim: usize) -> Result<(), String>
pub fn validate_embedding_dimension(dim: usize) -> Result<(), String>
Validate EMBEDDING dimension is within allowed range
Trait Implementations§
Source§impl Clone for KalamDataType
impl Clone for KalamDataType
Source§fn clone(&self) -> KalamDataType
fn clone(&self) -> KalamDataType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KalamDataType
impl Debug for KalamDataType
Source§impl<'de> Deserialize<'de> for KalamDataType
impl<'de> Deserialize<'de> for KalamDataType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<KalamDataType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<KalamDataType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for KalamDataType
impl Display for KalamDataType
impl Eq for KalamDataType
Source§impl Hash for KalamDataType
impl Hash for KalamDataType
Source§impl PartialEq for KalamDataType
impl PartialEq for KalamDataType
Source§fn eq(&self, other: &KalamDataType) -> bool
fn eq(&self, other: &KalamDataType) -> bool
self and other values to be equal, and is used by ==.