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
32-bit integer value
64-bit integer value
32-bit float value
64-bit double value
String value (also used for char(N) types) - borrowed reference
Date in YYYY-MM-DD format - borrowed reference
IPv4 in dotted-quad format (e.g., “192.168.1.100”) - borrowed reference
Decimal as string (e.g., “12345.6789”) - borrowed reference
Boolean value (true/false)
8-bit signed integer (-128 to 127)
16-bit signed integer (-32768 to 32767)
Timestamp as milliseconds since Unix epoch
DateTime in YYYY-MM-DD HH:MM:SS.mmm format - borrowed reference
Time in HH:MM:SS.mmm format - borrowed reference
UUID in standard format (e.g., “550e8400-e29b-41d4-a716-446655440000”) - borrowed reference
Unsigned long as string (0 to 18446744073709551615) - borrowed reference
Null
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