pub enum ShardKeyValue<‘a>
Typed shard key value to avoid string parsing overhead.
Use typed variants when possible for better performance. String variants are provided for complex types that require parsing.
Performance Notes
- Numeric types (
Int,Long,Float,Double,Boolean,Int8,Int16) areCopyand zero-cost - String references (
String,Date,Ipv4,Decimal, etc.) are borrowed - no allocation - All variants are
Copyfor zero-cost passing
Variants
Int(i32)
32-bit integer value
Long(i64)
64-bit integer value
Float(f32)
32-bit float value
Double(f64)
64-bit double value
String(&‘a str)
String value (also used for char(N) types) - borrowed reference
Date(&‘a str)
Date in YYYY-MM-DD format - borrowed reference
Ipv4(&‘a str)
IPv4 in dotted-quad format (e.g., “192.168.1.100”) - borrowed reference
Decimal(&‘a str)
Decimal as string (e.g., “12345.6789”) - borrowed reference
Boolean(bool)
Boolean value (true/false)
Int8(i8)
8-bit signed integer (-128 to 127)
Int16(i16)
16-bit signed integer (-32768 to 32767)
Timestamp(i64)
Timestamp as milliseconds since Unix epoch
DateTime(&‘a str)
DateTime in YYYY-MM-DD HH:MM:SS.mmm format - borrowed reference
Time(&‘a str)
Time in HH:MM:SS.mmm format - borrowed reference
Uuid(&‘a str)
UUID in standard format (e.g., “550e8400-e29b-41d4-a716-446655440000”) - borrowed reference
Ulong(&‘a str)
Unsigned long as string (0 to 18446744073709551615) - borrowed reference
A null value, for a column of any type. It encodes as zero bytes in the width of the column’s encoding.
Trait Implementations
impl<‘a> Clone for ShardKeyValue<‘a>
fn clone(&self) -> ShardKeyValue<‘a>
fn clone_from(&mut self, source: &Self)
source. Read more